Skip to content

Conversation

@DealsBeam
Copy link

The 'decode' function in 'src/js/util.js' was vulnerable to infinite recursion with certain malformed URI strings. It also failed to decode some valid URI-encoded strings.

This commit replaces the recursive implementation with an iterative 'while' loop. This is a more robust way to handle repeated decoding and prevents stack overflow errors.

A new test case has been added to 'tools/test_decode.js' to verify the fix. The test fails before the fix and passes after, proving the bug is resolved.

google-labs-jules bot and others added 2 commits November 2, 2025 03:15
The 'decode' function in 'src/js/util.js' was vulnerable to infinite recursion with certain malformed URI strings. It also failed to decode some valid URI-encoded strings.

This commit replaces the recursive implementation with an iterative 'while' loop. This is a more robust way to handle repeated decoding and prevents stack overflow errors.

A new test case has been added to 'tools/test_decode.js' to verify the fix. The test fails before the fix and passes after, proving the bug is resolved.
Fix URI decoding and add test
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