Bug #4368
Undefined behavior in Block operator==
Start date:
Due date:
% Done:
100%
Estimated time:
Description
If both lhs
and rhs
have zero length, operator==
passes nullptr
to memcmp()
, which is undefined behavior.
Found by UBSan:
../tests/unit-tests/data.t.cpp(40): Entering test suite "TestData" ../tests/unit-tests/data.t.cpp(259): Entering test case "Equality" ../src/encoding/block.cpp:507:18: runtime error: null pointer passed as argument 1, which is declared to never be null ../src/encoding/block.cpp:507:18: runtime error: null pointer passed as argument 2, which is declared to never be null ../tests/unit-tests/data.t.cpp(265): info: check a == b == true has passed [...]
Updated by Davide Pesavento over 3 years ago
- Status changed from New to Code review
- % Done changed from 0 to 100