Files
FastSync/tests/fuzz/fuzz_delta_deserialize.c
T
TapTap eb8651e3d5 fix: address PR review — fuzz target fixes, UBSan, CI improvements
Critical fixes:
- Add missing #include <string.h> to 5 fuzz targets (wouldn't compile with GCC14+/Clang16+)
- Fix fuzz_metadata_from_buf.c OOB read: guard size >= sizeof(int) + FILE_METADATA_WIRE_SIZE
- Add Clang compiler check for ENABLE_FUZZ in CMakeLists.txt (fail fast at configure time)
- Add fuzz-build CI job (install clang, build all 6 fuzz targets with ENABLE_FUZZ=ON)

Warning fixes:
- Add UBSan to sanitizer CI matrix (address + undefined)
- Remove tautological test_property_glob_consistency (pure/deterministic function)
- Use fixed seed srand(42) instead of srand(time(NULL)) for reproducible property tests
- Add valid-header + truncated-instructions delta robustness test (exercises instruction-loop error paths)
- Fix lcov --remove to exclude '*/_deps/*' (xxhash coverage pollution)
- Add comment explaining FASTSYNC_UNDER_VALGRIND skip in test_file.c
- Update .gitignore for build-*/ directories
2026-07-20 14:44:41 +02:00

27 lines
448 B
C

#include "delta.h"
#include "data.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (size == 0)
return 0;
void* buf = malloc(size);
if (!buf)
return 0;
memcpy(buf, data, size);
Data* d = data_create(buf, size);
if (!d)
return 0;
Delta* delta = delta_deserialize(d);
if (delta)
delta_destroy(delta);
data_destroy(d);
return 0;
}