Actions
Bug #4368
closedUndefined 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 about 7 years ago
- Status changed from New to Code review
- % Done changed from 0 to 100
Updated by Davide Pesavento about 7 years ago
- Status changed from Code review to Closed
Actions