diff options
author | obrien <obrien@FreeBSD.org> | 2013-07-03 22:46:30 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2013-07-03 22:46:30 +0000 |
commit | 441e4b8972d2ad6e7802684f31370c147ea5bc50 (patch) | |
tree | f06c5a5fe068dd01397380714c832827adb30a61 /usr.bin/patch | |
parent | d45f18e9d7e0dfff49a12196a8f4c325eefee716 (diff) | |
download | FreeBSD-src-441e4b8972d2ad6e7802684f31370c147ea5bc50.zip FreeBSD-src-441e4b8972d2ad6e7802684f31370c147ea5bc50.tar.gz |
Merge r252513 from src/gnu/usr.bin/patch into src/usr.bin/patch:
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 'usr.bin/patch')
-rw-r--r-- | usr.bin/patch/pch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c index c4792b2..c6224e7 100644 --- a/usr.bin/patch/pch.c +++ b/usr.bin/patch/pch.c @@ -1204,7 +1204,7 @@ pgets(bool do_indent) indent++; } } - strncpy(buf, line, len - skipped); + memcpy(buf, line, len - skipped); buf[len - skipped] = '\0'; } return len; |