Page MenuHomeFreeBSD

patch(1): Don't overrun line buffer if line is not completely malformed
ClosedPublic

Authored by kevans on Oct 6 2017, 4:39 PM.
Tags
None
Referenced Files
F169498166: D12609.id.diff
Tue, Sep 1, 5:26 PM
F169476134: D12609.id33761.diff
Tue, Sep 1, 3:31 PM
F169468979: D12609.id33840.diff
Tue, Sep 1, 3:07 PM
F169409776: D12609.diff
Tue, Sep 1, 11:29 AM
Unknown Object (File)
Sun, Aug 30, 3:57 PM
Unknown Object (File)
Sun, Aug 30, 2:10 PM
Unknown Object (File)
Sun, Aug 30, 1:51 PM
Unknown Object (File)
Sun, Aug 30, 1:00 PM
Subscribers

Details

Summary

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 11926
Build 12258: arc lint + arc unit

Event Timeline

Whoops, it's still possible to run out of memory there, and this looks a little
cleaner

This revision is now accepted and ready to land.Oct 7 2017, 3:36 AM
This revision was automatically updated to reflect the committed changes.