Date: Tue, 2 Jul 2013 17:17:42 +0000 (UTC) From: "David E. O'Brien" <obrien@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252513 - head/gnu/usr.bin/patch Message-ID: <201307021717.r62HHg9f015024@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: obrien Date: Tue Jul 2 17:17:42 2013 New Revision: 252513 URL: http://svnweb.freebsd.org/changeset/base/252513 Log: Properly handle input lines containing NUL characters such that pgets() accurately fills the read buffer. Callers of pgets() still mis-process the buffer contents if the read line contains NUL characters, but this at least makes pgets() accurate. Modified: head/gnu/usr.bin/patch/pch.c Modified: head/gnu/usr.bin/patch/pch.c ============================================================================== --- head/gnu/usr.bin/patch/pch.c Tue Jul 2 17:09:57 2013 (r252512) +++ head/gnu/usr.bin/patch/pch.c Tue Jul 2 17:17:42 2013 (r252513) @@ -1181,7 +1181,7 @@ pgets(bool do_indent) indent++; } } - Strncpy(buf, line, len - skipped); + memcpy(buf, line, len - skipped); buf[len - skipped] = '\0'; } return len;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307021717.r62HHg9f015024>