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
When a message signature contains an array, but the message body actually contains no elements, parsing incorrectly fails with DemarshalError::MismatchedParens, due to invalid handling in
// Now that we're done with our elements we can forget the elements consumed by demarshal
letmut mysig = sig.clone();
mysig.truncate(sig.len() - sig_copy.len());
mysig.insert(0,'a');
*sig = sig_copy;
Note that if the while loop doesn't execute even once, sig_copy will remain empty, and the currently parsed sig will be unconditionally emptied, instead of being set to fields remaining to be parsed.
Maybe I'll fix the bug myself later and publish a PR, but meanwhile here's an example failing test case with an array in the middle of a simple struct. Both nonempty and empty array tests are added for contrast.
When a message signature contains an array, but the message body actually contains no elements, parsing incorrectly fails with
DemarshalError::MismatchedParens
, due to invalid handling indbus-bytestream/src/demarshal.rs
Lines 185 to 195 in f7f7d1c
Note that if the while loop doesn't execute even once,
sig_copy
will remain empty, and the currently parsedsig
will be unconditionally emptied, instead of being set to fields remaining to be parsed.Maybe I'll fix the bug myself later and publish a PR, but meanwhile here's an example failing test case with an array in the middle of a simple struct. Both nonempty and empty array tests are added for contrast.
albel727@460d6c1
The text was updated successfully, but these errors were encountered: