]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r324431: patch(1): Don't overrun line buffer in some cases
authorkevans <kevans@FreeBSD.org>
Thu, 18 Jan 2018 21:46:42 +0000 (21:46 +0000)
committerkevans <kevans@FreeBSD.org>
Thu, 18 Jan 2018 21:46:42 +0000 (21:46 +0000)
commit74eac5ce4a8596f71ab65a2a416dca94cdb17fe7
tree546e3ca4a26dd3f080f071825f2747c8ef2ac0c3
parentf1935666e0471636cfda55938bd57fff70648277
MFC r324431: patch(1): Don't overrun line buffer in some cases

Patches like file.txt attached to PR 190195 with a final line formed
like ">(EOL)" could cause a copy past the end of the current line buffer. In
the case of PR 191641, this caused a duplicate line to be copied into the
resulting file.

Instead of running past the end, treat it as if it were a blank line.

PR: 191641
usr.bin/patch/pch.c