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

Out of bounds access when using parser.parse on 0-length memory view in 4.0.0 #81

Closed
chutz opened this issue May 23, 2021 · 1 comment
Closed

Comments

@chutz
Copy link

chutz commented May 23, 2021

This code will result in an out of bounds memory access exception:

import simdjson

simdjson.Parser().parse(memoryview(b""))

The output is

Traceback (most recent call last):
  File "test.py", line 3, in <module>
    simdjson.Parser().parse(memoryview(b""))
  File "simdjson/csimdjson.pyx", line 484, in csimdjson.Parser.parse
IndexError: Out of bounds on buffer access (axis 0)

It should raise a ValueError complaining that no JSON was found rather than an index error, as an empty bytes does.

@TkTech TkTech closed this as completed in 1145be6 May 23, 2021
@TkTech
Copy link
Owner

TkTech commented May 23, 2021

Thanks! This will go out as 4.0.1 once the tests and release pass.

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

No branches or pull requests

2 participants