platform_system_core/libziparchive/libziparchive_fuzzer.cpp
Elliott Hughes f66460b92a libziparchive: add trivial fuzzer.
Didn't find anything when I ran it, but it did get me to fix the
const/non-const void* in the API.

Test: treehugger
Change-Id: If3849d974965e3e5ffcbdaf5e47921316d717410
2019-10-22 11:45:49 -07:00

13 lines
321 B
C++

// SPDX-License-Identifier: Apache-2.0
#include <stddef.h>
#include <stdint.h>
#include <ziparchive/zip_archive.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
ZipArchiveHandle handle = nullptr;
OpenArchiveFromMemory(data, size, "fuzz", &handle);
CloseArchive(handle);
return 0;
}