From owner-svn-src-all@FreeBSD.ORG Mon Dec 6 09:18:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18BF01065679; Mon, 6 Dec 2010 09:18:12 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07C5A8FC15; Mon, 6 Dec 2010 09:18:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB69IBms027168; Mon, 6 Dec 2010 09:18:11 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB69IB9L027166; Mon, 6 Dec 2010 09:18:11 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201012060918.oB69IB9L027166@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 6 Dec 2010 09:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216224 - head/usr.bin/truss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 09:18:12 -0000 Author: jh Date: Mon Dec 6 09:18:11 2010 New Revision: 216224 URL: http://svn.freebsd.org/changeset/base/216224 Log: Don't write the terminating NUL past end of buffer. PR: bin/152345 Submitted by: Mateusz Guzik Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Mon Dec 6 00:19:56 2010 (r216223) +++ head/usr.bin/truss/syscalls.c Mon Dec 6 09:18:11 2010 (r216224) @@ -518,7 +518,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); } }