Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Apr 2011 16:06:39 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r220426 - stable/7/usr.bin/truss
Message-ID:  <201104071606.p37G6dDa045532@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 		}
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104071606.p37G6dDa045532>