( )⚙ D3729 bitmanipulation: fix undefined behavior in bit shift in getbe32

This is an archive of the discontinued Mercurial Phabricator instance.

bitmanipulation: fix undefined behavior in bit shift in getbe32
ClosedPublic

Authored by durin42 on Jun 13 2018, 10:24 AM.

Details

Summary

OSS-Fuzz caught this in its ubsan mode[0]. I'm not worried about a
security issue here because in practice this should work out the way
we naively expected, we're just making things explicit to the
compiler with the casts.

0: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8876

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

durin42 created this revision.Jun 13 2018, 10:24 AM
This revision was automatically updated to reflect the committed changes.