Skip to content

Conversation

@mkantor
Copy link
Contributor

@mkantor mkantor commented Apr 4, 2020

When parsing a bare hexadecimal number like JSON5.parse('0x1'), the parser was looping forever here because it was reading to the end and util.isHexDigit(undefined) === true.

I updated all of the util.is* functions to return false for undefined and added some regression tests.

Fixes #228.

@mkantor mkantor changed the title Fix #228. Fix OOM when parsing bare hexadecimal literal. Apr 4, 2020
@jordanbtucker jordanbtucker self-assigned this Apr 4, 2020
@jordanbtucker jordanbtucker merged commit f1d3c8a into json5:master Apr 4, 2020
@jordanbtucker
Copy link
Member

Thanks for finding and fixing this bug. The fix should be live in v2.1.3 now.

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.

Attempting to parse hexadecimal integer literal results in OOM

2 participants