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

Sporadic crashes on AES-CTR #88

Open
powersmc opened this issue Sep 30, 2024 · 0 comments
Open

Sporadic crashes on AES-CTR #88

powersmc opened this issue Sep 30, 2024 · 0 comments

Comments

@powersmc
Copy link

On three instances, I encountered bugs where the parser would crash (SEGFAULT) when attempting to process an AES-CTR vector. That being said, based on my investigation I don't think the issue was unique to AES-CTR. I believe the core issue resides here:

https://github.com/smuellerDD/acvpparser/blob/master/parser/read_json.c#L506

This code uses mmap to access the file contents as a buffer, and then subsequent code passes the buffer to string functions like strlen (https://github.com/smuellerDD/acvpparser/blob/master/parser/json-c/json_tokener.c#L260), which can end up accessing past the end of the buffer, as mmap doesn't guarantee a NULL terminator at the end of the buffer.

I was able to fix this locally by just switching from mmap to malloc, and adding in a NULL terminator myself. I can create a PR if desired, but I wasn't sure if that's the approach you wanted to take to fix this issue, or if you had something else in mind.

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

1 participant