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
Unknown Object (File)
Oct 4 2024, 1:55 AM
Unknown Object (File)
Oct 3 2024, 1:59 PM
Unknown Object (File)
Oct 1 2024, 1:34 PM
Unknown Object (File)
Oct 1 2024, 11:26 AM
Unknown Object (File)
Oct 1 2024, 8:30 AM
Unknown Object (File)
Sep 20 2024, 10:18 AM
Unknown Object (File)
Sep 8 2024, 8:33 PM
Unknown Object (File)
Sep 8 2024, 5:24 PM
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 Passed
Unit
No Test Coverage
Build Status
Buildable 51967
Build 48858: arc lint + arc unit

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