Skip to content

Commit

Permalink
expr(1): adapt for honggfuzz and AFL
Browse files Browse the repository at this point in the history
  • Loading branch information
plusun committed Jul 3, 2018
1 parent ff93df2 commit 14bd975
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bin/expr/expr.y
Expand Up @@ -485,6 +485,20 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
free(argv);
return 0;
}

int main(int argc, const char * const *argv)
{
setprogname(argv[0]);
(void)setlocale(LC_ALL, "");
#define N 4096
uint8_t arr[N];
ssize_t ret = read(0, arr, N - 1);
if (ret > 0) {
arr[ret] = 0;
return LLVMFuzzerTestOneInput(arr, ret);
}
return 0;
}
#else

int
Expand Down

0 comments on commit 14bd975

Please sign in to comment.