Closed benpicco closed 3 years ago
Why is it necessary to decrement remaining
here in the first place?
NanoCBOR still fails to parse
echo v2NzZXECY2NtZIe/Y2xlZPT/v2VkZWxheRkB9P+/ZGVjaG9pSSdtIGRvbmUh/79jbGVk9f+/ZWRlbGF5GQH0/79jbGVk9P+/ZGVjaG9tTm93IEknbSBkb25lIf9jY2Zn9v8= | base64 -d | bin/fuzztest`
http://cbor.me parses the message correctly (replace bin/fuzztest
with xdd -i
and paste the hex array there).
Let's try this with #52
For indefinite containers
remaining
is 0, meaning that a call tonanocbor_leave_container()
will create an underflow.This causes
nanocbor_at_end()
to no longer being able to detect the end of the container.e.g. trying to decode this message (with garbage padding bytes to trigger the issue) will attempt to decode the map past it's last element.
master
this patch