Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very long string crash nodejs #232

Open
jlguardi opened this issue Jun 15, 2020 · 0 comments · May be fixed by #233
Open

Very long string crash nodejs #232

jlguardi opened this issue Jun 15, 2020 · 0 comments · May be fixed by #233
Assignees
Milestone

Comments

@jlguardi
Copy link

I've experienced some issues with long strings:

  • Very slow parsing on long strings (1MB)
  • Crash with very long strings: Due to recursive calls and string concatenation, the current implementation crashes with 100MB strings.

I've included 2 test cases to validate this behaviour:

        t.equal(
            JSON5.parse("'" + 'a'.repeat(1000 * 1000) + "'"),
            'a'.repeat(1000 * 1000),
            'parse long json string (1MB)'
        )

        t.equal(
            JSON5.parse("'" + 'a'.repeat(100 * 1000 * 1000) + "'"),
            'a'.repeat(100 * 1000 * 1000),
            'parse very long json string (100MB)'
        )

Related with #85 and #164

@jlguardi jlguardi linked a pull request Jun 15, 2020 that will close this issue
@jordanbtucker jordanbtucker self-assigned this Feb 23, 2022
@jordanbtucker jordanbtucker added this to the v3.0.0 milestone Feb 23, 2022
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 a pull request may close this issue.

2 participants