Skip to content

Fix WABT_PRINTF_TYPE_CODE to correctly handle INT_MIN - #2792

Merged
lexi-nadia merged 5 commits into
WebAssembly:mainfrom
lexi-nadia:fuzz2
Jul 8, 2026
Merged

lexi-nadia merged 5 commits into
WebAssembly:mainfrom
lexi-nadia:fuzz2

Conversation

@lexi-nadia

Copy link
Copy Markdown
Collaborator

This fixes a fuzzer-discovered edge case: the result of std::abs(INT_MIN) is undefined behavior.

This fixes a fuzzer-discovered edge case: the result of std::abs(INT_MIN) is undefined behavior.
@sbc100 sbc100 changed the title fix WABT_PRINTF_TYPE_CODE to correctly handle INT_MIN Fix WABT_PRINTF_TYPE_CODE to correctly handle INT_MIN Jul 7, 2026
@sbc100

sbc100 commented Jul 7, 2026

Copy link
Copy Markdown
Member

Don't our type codes have a very limited range though? Can this be called with arbitrary values?

@lexi-nadia

Copy link
Copy Markdown
Collaborator Author

Don't our type codes have a very limited range though? Can this be called with arbitrary values?

WABT_PRINTF_TYPE_CODE(type_code));

If this is the real problem, I'm happy to fix this instead!

Comment thread include/wabt/string-format.h Resolved
Comment thread include/wabt/string-format.h Resolved
@lexi-nadia
lexi-nadia enabled auto-merge (squash) July 8, 2026 19:05
@lexi-nadia
lexi-nadia merged commit 814c8e3 into WebAssembly:main Jul 8, 2026
17 checks passed
@lexi-nadia
lexi-nadia deleted the fuzz2 branch July 8, 2026 20:23
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