svn commit: r220291 - stable/8/usr.bin/truss

Jaakko Heinonen jh at FreeBSD.org
Sun Apr 3 08:44:57 UTC 2011


Author: jh
Date: Sun Apr  3 08:44:57 2011
New Revision: 220291
URL: http://svn.freebsd.org/changeset/base/220291

Log:
  MFC r216224:
  
  Don't write the terminating NUL past end of buffer.
  
  PR:		bin/152345

Modified:
  stable/8/usr.bin/truss/syscalls.c
Directory Properties:
  stable/8/usr.bin/truss/   (props changed)

Modified: stable/8/usr.bin/truss/syscalls.c
==============================================================================
--- stable/8/usr.bin/truss/syscalls.c	Sun Apr  3 05:09:25 2011	(r220290)
+++ stable/8/usr.bin/truss/syscalls.c	Sun Apr  3 08:44:57 2011	(r220291)
@@ -516,7 +516,7 @@ get_string(pid_t pid, void *offset, int 
 			buf = realloc(buf, totalsize);
 			size = BLOCKSIZE;
 		} else {
-			buf[totalsize] = '\0';
+			buf[totalsize - 1] = '\0';
 			return (buf);
 		}
 	}


More information about the svn-src-all mailing list