diff options
author | William A. Kennington III <wak@google.com> | 2019-04-08 20:27:26 -0700 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2019-04-11 18:40:25 -0700 |
commit | 0d49e47978d5f2d0b108b0ddc65943763e88f729 (patch) | |
tree | 73aaa9c1141a2e7425e92cb0ff660e0afcf7331e /storagehandler.hpp | |
parent | 11df4f6906edc0dfb23089a6e297158549c19ebd (diff) | |
download | phosphor-host-ipmid-0d49e47978d5f2d0b108b0ddc65943763e88f729.tar.gz phosphor-host-ipmid-0d49e47978d5f2d0b108b0ddc65943763e88f729.zip |
message/unpack: Fix undefined behavior
It's UB to shift an integer by the size of that integer. More
specifically, if you disable compiler optimization and try and unpack a
32 bit bitset you will end up with a 0x0 mask. Avoid UB by replacing
shift subtract with a negate shift.
Tested:
Unit tests pass now.
Change-Id: I03a6f866a51c955b57787d641da9180841747e4c
Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'storagehandler.hpp')
0 files changed, 0 insertions, 0 deletions