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

SIGSEGV if nativejson is run from certain directories #108

Open
cebtenzzre opened this issue Sep 20, 2018 · 0 comments
Open

SIGSEGV if nativejson is run from certain directories #108

cebtenzzre opened this issue Sep 20, 2018 · 0 comments

Comments

@cebtenzzre
Copy link

If the nativejson binary is run from certain directories (such as the root of the repository), ReadFiles fails twice:

if (!ReadFiles("../data/%s", testJsons))

So testJsons has length 0 and capacity 0. That makes testJsons.front() invalid, as no memory has been allocated for the vector yet. So here:
char * const argv[] = { fullpath, testJsons.front().fullpath, NULL };

A null pointer is dereferenced, causing a segfault.

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