diff options
author | obrien <obrien@FreeBSD.org> | 2013-07-02 17:17:42 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2013-07-02 17:17:42 +0000 |
commit | 1fafe35d7577b9b0ab13b4f1f8e13660d9305936 (patch) | |
tree | f7d567919fa237a964cf611381c906139bef1aaf /gnu | |
parent | ef0cb7bd8f952dec5096bca3f237925a680b7e4b (diff) | |
download | FreeBSD-src-1fafe35d7577b9b0ab13b4f1f8e13660d9305936.zip FreeBSD-src-1fafe35d7577b9b0ab13b4f1f8e13660d9305936.tar.gz |
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.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/patch/pch.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |