diff options
author | plusun <tomsun.0.7@gmail.com> | 2018-08-06 07:16:24 +0000 |
---|---|---|
committer | plusun <tomsun.0.7@gmail.com> | 2018-08-06 07:16:24 +0000 |
commit | 98022490a8a44232f6c56f8aba7628d97875a0a4 (patch) | |
tree | ec5143e742c2c20c684276c2680104d0c39082b2 /input.c | |
parent | e2635e5a786552ee22bc167d0b2af5b2bd4b5fd4 (diff) | |
download | honggfuzz-98022490a8a44232f6c56f8aba7628d97875a0a4.tar.gz |
detect 'only-printable' inside input_setSize to reduce modifications
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -56,7 +56,11 @@ void input_setSize(run_t* run, size_t sz) { if (sz > run->global->mutate.maxFileSz) { PLOG_F("Too large size requested: %zu > maxSize: %zu", sz, run->global->mutate.maxFileSz); } + size_t old_sz = run->dynamicFileSz; run->dynamicFileSz = sz; + if (run->global->cfg.only_printable && old_sz < sz) { + memset(run->dynamicFile, ' ', sz - old_sz); + } } static bool input_getDirStatsAndRewind(honggfuzz_t* hfuzz) { |