svn commit: trunk/busybox/libbb

landley at busybox.net landley at busybox.net
Tue Jun 27 18:14:13 UTC 2006


Author: landley
Date: 2006-06-27 11:14:12 -0700 (Tue, 27 Jun 2006)
New Revision: 15532

Log:
Fix http://bugs.busybox.net/view.php?id=906 which could cause failures in top.


Modified:
   trunk/busybox/libbb/procps.c


Changeset:
Modified: trunk/busybox/libbb/procps.c
===================================================================
--- trunk/busybox/libbb/procps.c	2006-06-27 14:41:35 UTC (rev 15531)
+++ trunk/busybox/libbb/procps.c	2006-06-27 18:14:12 UTC (rev 15532)
@@ -28,7 +28,8 @@
 	fd = open(filename, O_RDONLY);
 	if(fd < 0)
 		return -1;
-	ret = read(fd, buf, PROCPS_BUFSIZE);
+	ret = read(fd, buf, PROCPS_BUFSIZE-1);
+	((char *)buf)[ret > 0 ? ret : 0] = 0;
 	close(fd);
 	return ret;
 }




More information about the busybox-cvs mailing list