summaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorplusun <tomsun.0.7@gmail.com>2018-08-06 07:16:24 +0000
committerplusun <tomsun.0.7@gmail.com>2018-08-06 07:16:24 +0000
commit98022490a8a44232f6c56f8aba7628d97875a0a4 (patch)
treeec5143e742c2c20c684276c2680104d0c39082b2 /input.c
parente2635e5a786552ee22bc167d0b2af5b2bd4b5fd4 (diff)
downloadhonggfuzz-98022490a8a44232f6c56f8aba7628d97875a0a4.tar.gz
detect 'only-printable' inside input_setSize to reduce modifications
Diffstat (limited to 'input.c')
-rw-r--r--input.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/input.c b/input.c
index bc5d3827..414defed 100644
--- a/input.c
+++ b/input.c
@@ -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) {