File: fuzz.c

package info (click to toggle)
zsv 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 49,160 kB
  • sloc: ansic: 175,811; cpp: 56,301; sh: 3,623; makefile: 3,048; javascript: 577; cs: 90; awk: 70; python: 41; sql: 15
file content (16 lines) | stat: -rw-r--r-- 342 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <unistd.h>
#include "../src/zsv.c"

__AFL_FUZZ_INIT();

int main() {
  __AFL_INIT();
  unsigned char *src = 0;
  unsigned char *buf = __AFL_FUZZ_TESTCASE_BUF;
  while (__AFL_LOOP(10000)) {
    int len = __AFL_FUZZ_TESTCASE_LEN;
    src = realloc(src, len);
    memcpy(src, buf, len);
    zsv_parse_bytes(zsv_new(0), src, len);
  }
}