Page MenuHomeFreeBSD

usr.bin/diff: fix UBSan error in readhash
ClosedPublic

Authored by arichardson on Jul 6 2021, 11:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 11, 2:58 PM
Unknown Object (File)
Fri, Sep 11, 6:31 AM
Unknown Object (File)
Tue, Sep 8, 11:45 AM
Unknown Object (File)
Tue, Sep 8, 5:00 AM
Unknown Object (File)
Sat, Sep 5, 2:11 PM
Unknown Object (File)
Aug 15 2026, 2:44 AM
Unknown Object (File)
Aug 14 2026, 4:21 PM
Unknown Object (File)
Aug 9 2026, 6:25 PM
Subscribers

Details

Summary

UBSan complains about the sum = sum * 127 + chrtran(t); line below since
that can overflow an int. Use unsigned int instead to ensure that
overflow is well-defined.

Diff Detail

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