Skip to content

parser cbor BUGFIX negative integers below INT64_MIN - #2597

Open
affan-arch wants to merge 1 commit into
CESNET:develfrom
affan-arch:cbor-negint-range
Open

affan-arch wants to merge 1 commit into
CESNET:develfrom
affan-arch:cbor-negint-range

Conversation

@affan-arch

Copy link
Copy Markdown

lydcbor_item_to_string() converted a CBOR negative integer -1 - n as -1 - (int64_t)n, which wraps for n > INT64_MAX, so e.g. -18446744073709551611 was accepted into a uint8 leaf as 5 (and -2^64 as 0); printing the exact value from the uint64_t instead lets the type plugins reject it the same way they do for JSON/XML, and test_negint covers both cases.

@michalvasko michalvasko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, looks fine.

@michalvasko
michalvasko changed the base branch from master to devel October 23, 2026 07:48
@michalvasko

Copy link
Copy Markdown
Member

I have changed the target branch to devel, please use that one always for PRs but it seems there was another tests added so please rebase your changes for this branch.

@affan-arch

Copy link
Copy Markdown
Author

rebased on devel, the conflict was just test_negint sitting next to the new test_invalid_input in test_cbor.c, kept both. will target devel from now on.

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