Skip to content

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

Merged
merged 5 commits into from
Jun 6, 2025

Conversation

shresss
Copy link
Contributor

@shresss shresss commented Jun 5, 2025

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.

Adds gridRing testing to fuzzerGridDisk.c to improve test coverage
as requested in uber#1011 and as I tried but ran into merge issues with in uber#1012.
@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@coveralls
Copy link

coveralls commented Jun 5, 2025

Coverage Status

coverage: 98.804%. remained the same
when pulling e6ecdaa on shresss:gridring-clean
into 6be0899 on uber:master.

Comment on lines 59 to 63
results = calloc(sizeof(H3Index), sz);
if (results != NULL) {
H3_EXPORT(gridRing)(args->index, args->k, results); // Test the safe version
}
free(results);
Copy link
Contributor

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

@shresss
Copy link
Contributor Author

shresss commented Jun 5, 2025

move to below gridRingUnsafe and formating corrected!

@@ -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);
Copy link
Collaborator

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

@shresss
Copy link
Contributor Author

shresss commented Jun 5, 2025

fixed, sorry was working on issue #984 did this change a bit too quickly

@isaacbrodsky isaacbrodsky merged commit e4c977a into uber:master Jun 6, 2025
45 checks passed
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

Successfully merging this pull request may close these issues.

5 participants