Skip to content

printer cbor BUGFIX double free when printing opaque lists - #2601

Open
affan-arch wants to merge 1 commit into
CESNET:masterfrom
affan-arch:cbor-opaq-list-double-free
Open

affan-arch wants to merge 1 commit into
CESNET:masterfrom
affan-arch:cbor-opaq-list-double-free

Conversation

@affan-arch

Copy link
Copy Markdown

cbor_print_opaq() generates the member name of an opaque list/leaf-list on the first instance and frees it twice when that instance is also the last one (ASan: double-free), while with several instances the name is already gone when the array is completed so the whole list is silently dropped from the output; any data holding an unknown list inside anydata (e.g. {"cbor-test:anydata-payload":{"foo:bar":[{"x":"y"}]}} parsed with default options) or parsed with LYD_PARSE_OPAQ triggers it when printed as CBOR, so generate the name once the array is completed like cbor_print_leaf_list() does, and test_opaque_list covers both cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant