You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be no list size check done when decoding an object (possible also in general for lists?).
e.g. when decoding ef8c000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000080 to a WhoAreYouObj, that works as expected, as the rlp is valid.
However, decoding c08c000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000080 to a WhoAreYouObj, also works, while clearly the list size (c0 -> size 0) is not correct.
Only spotted this by adding a re-encode step and comparing with original payload in a fuzzing test.
Just ran into that issue when debugging wire protocol datagrams as processed by checkedRlpRead(). In particular, r.read(MsgType) succeeds when r is a non-empty list and MsgType is EmptyList and also when r is a list of more than one element and MsgType is DisconnectionReasonList, a single element object. The latter one coincides with the reported issue, above.
There seems to be no list size check done when decoding an object (possible also in general for lists?).
e.g. when decoding
ef8c000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000080
to aWhoAreYouObj
, that works as expected, as the rlp is valid.However, decoding
c08c000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000080
to aWhoAreYouObj
, also works, while clearly the list size (c0 -> size 0) is not correct.Only spotted this by adding a re-encode step and comparing with original payload in a fuzzing test.
Perhaps related with #254
The text was updated successfully, but these errors were encountered: