Skip to content

cborpretty: fix assertion failure if recursion limit was hit#230

Merged
thiagomacieira merged 1 commit intomainfrom
unknown repository
Feb 13, 2023
Merged

cborpretty: fix assertion failure if recursion limit was hit#230
thiagomacieira merged 1 commit intomainfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Feb 13, 2023

Using cbordump on the enclosed input fails with an assertion error :

cbordump: src/cborparser.c:633: cbor_value_leave_container: Assertion `recursed->type == CborInvalidType' failed.

The problem is the following : there is an implicit assumption when quitting container_to_pretty that the iterator is advanced to its end. This assumption is broken whenever we reach the recursion limit.

The failing input was found by @niooss-ledger.
max-recurse-limit-fail-input.txt

@ghost ghost changed the title Advance to the end of the iterator if recursion limit was hit in cborpretty cborpretty: fix assertion failure if recursion limit was hit Feb 13, 2023
Copy link
Member

@thiagomacieira thiagomacieira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@thiagomacieira thiagomacieira merged commit 2455693 into intel:main Feb 13, 2023
@ghost ghost deleted the fix-pretty-max-recurse-limit branch February 13, 2023 19:54
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.

2 participants