-
Notifications
You must be signed in to change notification settings - Fork 515
feat(fuzzer): Add gridRing test to fuzzerGridDisk #1015
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
Conversation
src/apps/fuzzers/fuzzerGridDisk.c
Outdated
@@ -56,6 +56,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { | |||
H3_EXPORT(gridDiskUnsafe)(args->index, args->k, results); | |||
} | |||
free(results); | |||
results = calloc(sizeof(H3Index), sz); | |||
if (results != NULL) { | |||
H3_EXPORT(gridRing)(args->index, args->k, results); // Test the safe version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
H3_EXPORT(gridRing)(args->index, args->k, results); // Test the safe version | |
H3_EXPORT(gridRing)(args->index, args->k, results); // Test the safe version |
small formatting issue that will get flagged in CI
src/apps/fuzzers/fuzzerGridDisk.c
Outdated
results = calloc(sizeof(H3Index), sz); | ||
if (results != NULL) { | ||
H3_EXPORT(gridRing)(args->index, args->k, results); // Test the safe version | ||
} | ||
free(results); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe move the whole block to after gridRingUnsafe
move to below gridRingUnsafe and formating corrected! |
src/apps/fuzzers/fuzzerGridDisk.c
Outdated
@@ -56,6 +56,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { | |||
H3_EXPORT(gridDiskUnsafe)(args->index, args->k, results); | |||
} | |||
free(results); | |||
results = calloc(sizeof(H3Index), sz); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line should also move down or there will be a use-after-free
fixed, sorry was working on issue #984 did this change a bit too quickly |
Adds gridRing testing to fuzzerGridDisk.c to improve test coverage as requested in #1011 and as I tried but ran into merge issues with in #1012.