Summary: | patch(1) may misapply diffs missing final line feed | ||
---|---|---|---|
Product: | Base System | Reporter: | Gavin Atkinson <gavin> |
Component: | bin | Assignee: | Kyle Evans <kevans> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | cem, emaste, kevans, pfg, tablooaraz |
Priority: | --- | Flags: | kevans:
mfc-stable11+
|
Version: | 10.0-RELEASE | ||
Hardware: | Any | ||
OS: | Any |
Description
Gavin Atkinson
2014-07-05 21:26:45 UTC
Hi, Review pending for this: https://reviews.freebsd.org/D12609 (In reply to Kyle Evans from comment #1) Looks good. does it also fix PR 191641 ? (In reply to Pedro F. Giffuni from comment #2) That's this PR? (In reply to Conrad Meyer from comment #3) Sorry .. I meant 74127, which also refers to 84816. No, I don't see how this could fix 74127 (or 84816). (In reply to Conrad Meyer from comment #5) Well, the patch is correct but we may be missing the big picture(TM). No one is asking Kyle to fix all the bugs in patch(1) though ;). (In reply to Pedro F. Giffuni from comment #4) 74127 looks like a logical error elsewhere- I can poke at that sometime this upcoming week. A commit references this bug: Author: kevans Date: Mon Oct 9 14:50:02 UTC 2017 New revision: 324431 URL: https://svnweb.freebsd.org/changeset/base/324431 Log: 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 Reviewed by: cem, emaste, pfg Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D12609 Changes: head/usr.bin/patch/pch.c MARKED AS SPAM A commit references this bug: Author: kevans Date: Thu Jan 18 21:46:42 UTC 2018 New revision: 328147 URL: https://svnweb.freebsd.org/changeset/base/328147 Log: 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 Changes: _U stable/11/ stable/11/usr.bin/patch/pch.c |