svn commit: r220426 - stable/7/usr.bin/truss

Jaakko Heinonen jh at FreeBSD.org
Thu Apr 7 16:06:39 UTC 2011


Author: jh
Date: Thu Apr  7 16:06:39 2011
New Revision: 220426
URL: http://svn.freebsd.org/changeset/base/220426

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

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

Modified: stable/7/usr.bin/truss/syscalls.c
==============================================================================
--- stable/7/usr.bin/truss/syscalls.c	Thu Apr  7 14:17:55 2011	(r220425)
+++ stable/7/usr.bin/truss/syscalls.c	Thu Apr  7 16:06:39 2011	(r220426)
@@ -475,7 +475,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