diff options
author | Robert Swiecki <robert@swiecki.net> | 2019-02-11 00:33:27 +0100 |
---|---|---|
committer | Robert Swiecki <robert@swiecki.net> | 2019-02-11 00:33:27 +0100 |
commit | f31fdf7b8124db590d69df2cc67918809602916b (patch) | |
tree | 6917cb1ceb4266697532f4bc87aa82b60920f90c /input.c | |
parent | 106c2dd88247099249109c493fa5c3bf4a149324 (diff) | |
download | honggfuzz-f31fdf7b8124db590d69df2cc67918809602916b.tar.gz |
input: resize file to max before reading into it
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -341,6 +341,7 @@ bool input_prepareStaticFile(run_t* run, bool rewind) { } snprintf(run->origFileName, sizeof(run->origFileName), "%s", fname); + input_setSize(run, run->global->mutate.maxFileSz); ssize_t fileSz = files_readFileToBufMax(fname, run->dynamicFile, run->global->mutate.maxFileSz); if (fileSz < 0) { LOG_E("Couldn't read contents of '%s'", fname); @@ -375,6 +376,7 @@ bool input_prepareExternalFile(run_t* run) { } LOG_D("Subporcess '%s' finished with success", run->global->exe.externalCommand); + input_setSize(run, run->global->mutate.maxFileSz); ssize_t sz = files_readFromFdSeek(fd, run->dynamicFile, run->global->mutate.maxFileSz, 0); if (sz == -1) { LOG_E("Couldn't read file from fd=%d", fd); @@ -406,6 +408,7 @@ bool input_postProcessFile(run_t* run) { } LOG_D("Subporcess '%s' finished with success", run->global->exe.externalCommand); + input_setSize(run, run->global->mutate.maxFileSz); ssize_t sz = files_readFromFdSeek(fd, run->dynamicFile, run->global->mutate.maxFileSz, 0); if (sz == -1) { LOG_E("Couldn't read file from fd=%d", fd); |