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
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 inhttps://github.com/srwalter/dbus-bytestream/blob/f7f7d1c7c8d019b526243a54fb330a4776c26816/src/demarshal.rs#L185-L195
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.
https://github.com/albel727/dbus-bytestream/commit/460d6c185f2e7f51696f104f764d0bc115034218