From 1fafe35d7577b9b0ab13b4f1f8e13660d9305936 Mon Sep 17 00:00:00 2001 From: obrien Date: Tue, 2 Jul 2013 17:17:42 +0000 Subject: 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. --- gnu/usr.bin/patch/pch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/usr.bin/patch/pch.c b/gnu/usr.bin/patch/pch.c index e2c9548..37bbe56 100644 --- a/gnu/usr.bin/patch/pch.c +++ b/gnu/usr.bin/patch/pch.c @@ -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; -- cgit v1.1