Skip to content

Commit

Permalink
Cast remove() to void to avoid coverity warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
0-wiz-0 committed Sep 24, 2023
1 parent 9cb66d3 commit 24187e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions regress/zip_read_file_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {

za = zip_open(name, 0, NULL);
if (za == NULL) {
remove(name);
(void)remove(name);
fprintf(stderr, "Error opening archive '%s'\n", name);
return 1;
}
Expand All @@ -60,7 +60,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (f == NULL) {
fprintf(stderr, "Unable to open file %d.\n", (int)i);
zip_close(za);
remove(name);
(void)remove(name);
return 1;
}

Expand All @@ -70,16 +70,16 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (zip_fclose(f) < 0) {
fprintf(stderr, "Error closing file %d\n", (int)i);
zip_close(za);
remove(name);
(void)remove(name);
return 1;
}
}
if (zip_close(za) < 0) {
zip_discard(za);
remove(name);
(void)remove(name);
fprintf(stderr, "Error closing archiv '%s'\n", name);
return 1;
}
remove(name);
(void)remove(name);
return 0;
}
2 changes: 1 addition & 1 deletion regress/zip_write_encrypt_aes256_file_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
zip_discard(archive);
return -1;
}
remove(path);
(void)remove(path);

return 0;
}
2 changes: 1 addition & 1 deletion regress/zip_write_encrypt_pkware_file_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
zip_discard(archive);
return -1;
}
remove(path);
(void)remove(path);

return 0;
}

0 comments on commit 24187e0

Please sign in to comment.