Closed Roman- closed 2 years ago
Parser.h accepts the len argument as uint32_t, but then it passes it to detail::Parser<T>::parse which accepts it as uint16_t:
len
uint32_t
detail::Parser<T>::parse
uint16_t
https://github.com/microavia/messgen/blob/ea975688fae5723e8fe70c80a5f7a9726b1e16ef/port/cpp/messgen/Parser.h#L40 https://github.com/microavia/messgen/blob/ea975688fae5723e8fe70c80a5f7a9726b1e16ef/port/cpp/messgen/Dynamic.h#L57
This implicit type conversion uint32_t->uint16_t causes the bug that's not documented and is very hard to spot without deep debugging.
This is a bug, after moving from uint16 to uint32 for sizes. Fix please to uint32. Thanks for finding!
Parser.h accepts the
len
argument asuint32_t
, but then it passes it todetail::Parser<T>::parse
which accepts it asuint16_t
:https://github.com/microavia/messgen/blob/ea975688fae5723e8fe70c80a5f7a9726b1e16ef/port/cpp/messgen/Parser.h#L40 https://github.com/microavia/messgen/blob/ea975688fae5723e8fe70c80a5f7a9726b1e16ef/port/cpp/messgen/Dynamic.h#L57
This implicit type conversion uint32_t->uint16_t causes the bug that's not documented and is very hard to spot without deep debugging.