nativejson-benchmark icon indicating copy to clipboard operation
nativejson-benchmark copied to clipboard

SIGSEGV if nativejson is run from certain directories

Open cebtenzzre opened this issue 5 years ago • 0 comments

If the nativejson binary is run from certain directories (such as the root of the repository), ReadFiles fails twice: https://github.com/miloyip/nativejson-benchmark/blob/2d4e633eac404625a04dd77c0bfb53712ccb3ecd/src/main.cpp#L1238 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: https://github.com/miloyip/nativejson-benchmark/blob/2d4e633eac404625a04dd77c0bfb53712ccb3ecd/src/main.cpp#L726 A null pointer is dereferenced, causing a segfault.

cebtenzzre avatar Sep 20 '18 13:09 cebtenzzre