Page MenuHomeFreeBSD

hexdump: Partial lines cannot be repetitions of earlier lines.
ClosedPublic

Authored by delphij on Jun 8 2023, 7:02 AM.
Tags
None
Referenced Files
F171483360: D40471.id122991.diff
Fri, Sep 11, 9:33 AM
Unknown Object (File)
Sat, Aug 29, 2:03 PM
Unknown Object (File)
Fri, Aug 28, 1:49 PM
Unknown Object (File)
Mon, Aug 17, 2:39 PM
Unknown Object (File)
Aug 8 2026, 2:02 PM
Unknown Object (File)
Aug 4 2026, 9:13 AM
Unknown Object (File)
Aug 3 2026, 12:57 AM
Unknown Object (File)
Jul 23 2026, 12:10 AM
Subscribers

Details

Summary

When checking for repetitions of earlier lines, we compare the
first nread bytes of the line against the saved line. However,
when we read a partial line, it should never be treated as a
repetition of an earlier line, even if the first bytes match.

This change fixes a bug where a partial line could be
incorrectly identified as a repetition of an earlier line.

Reported-by: Mark Adler <madler@alumni.caltech.edu>
PR: 118723
MFC-after: 2 weeks

Test Plan

run tests

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste added inline comments.
usr.bin/hexdump/display.c
274

Maybe need > 0 for style? (Even if the rest of this file isn't fully style compliant)

This revision is now accepted and ready to land.Jun 8 2023, 11:59 AM