diff options
| author | Aldrik Ramaekers <aldrik@mailbox.org> | 2026-01-09 15:28:38 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@mailbox.org> | 2026-01-09 15:28:38 +0100 |
| commit | 210404a73706993d197c1290d5a411394e176fbe (patch) | |
| tree | 93c3ea9fc4691ca42f26dd92c6e14627af0b47af /libs/zip/fuzz/fuzz_entry.c | |
| parent | a65e876f3277a7d7fca6e5129ac3e200dae2d0dc (diff) | |
remove unused lib files
Diffstat (limited to 'libs/zip/fuzz/fuzz_entry.c')
| -rw-r--r-- | libs/zip/fuzz/fuzz_entry.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/libs/zip/fuzz/fuzz_entry.c b/libs/zip/fuzz/fuzz_entry.c deleted file mode 100644 index c2c5f0c..0000000 --- a/libs/zip/fuzz/fuzz_entry.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "zip.h" -#include <stdint.h> -#include <stdlib.h> - -int LLVMFuzzerTestOneInput(const uint8_t *data, const size_t size) { - /* Discard inputs larger than 1MB. */ - static const size_t MaxSize = 1024 * 1024; - if (size < 1 || size > MaxSize) { - return 0; - } - - void *buf = NULL; - size_t bufsize = 0; - struct zip_t *zip = zip_stream_open((const char *)data, size, 0, 'r'); - if (NULL == zip) { - goto end; - } - - const ssize_t zip_entries_count = zip_entries_total(zip); - - if (zip_entries_count <= 0) { - goto end; - } - - if (0 != zip_entry_openbyindex(zip, 0)) { - goto end; - } - - zip_entry_read(zip, &buf, &bufsize); - -end: - zip_entry_close(zip); - if (NULL != zip) { - zip_close(zip); - } - free(buf); - return 0; -} |
