Skip to content

Comments

CBOR-to-JSON: fix integer overflow when computing allocation size#280

Merged
thiagomacieira merged 1 commit intointel:mainfrom
niooss-ledger:cbor-to-json-fix-int-overflow
Mar 14, 2025
Merged

CBOR-to-JSON: fix integer overflow when computing allocation size#280
thiagomacieira merged 1 commit intointel:mainfrom
niooss-ledger:cbor-to-json-fix-int-overflow

Conversation

@niooss-ledger
Copy link
Contributor

Use add_check_overflow and mul_check_overflow to ensure the arithmetic operations do not overflow when computing the size to allocate.

Use add_check_overflow and mul_check_overflow to ensure the arithmetic
operations do not overflow when computing the size to allocate.
@thiagomacieira thiagomacieira force-pushed the cbor-to-json-fix-int-overflow branch from df7719d to dc1b08c Compare March 14, 2025 16:31
@thiagomacieira thiagomacieira enabled auto-merge (rebase) March 14, 2025 16:34
@thiagomacieira
Copy link
Member

Thanks, much appreciated.

As I said in #279, we probably should add testing of invalid rows in the tst_ToJson. We have plenty of invalid rows in the parser test's data.cpp.

@thiagomacieira thiagomacieira merged commit 6d31efa into intel:main Mar 14, 2025
6 checks passed
@niooss-ledger niooss-ledger deleted the cbor-to-json-fix-int-overflow branch March 15, 2025 21:20
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