You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
524 B
C

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "zlog.h"
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
char filename[256];
sprintf(filename, "/tmp/libfuzzer.%d", getpid());
FILE *fp = fopen(filename, "wb");
if (!fp)
return 0;
fwrite(data, size, 1, fp);
fclose(fp);
int rc = zlog_init(filename);
if (rc == 0)
{
zlog_fini();
}
unlink(filename);
return 0;
}