From f3280455ea7fd3730ebe448fb0c9aea56b45093e Mon Sep 17 00:00:00 2001 From: Will Dormann Date: Tue, 2 Feb 2016 13:55:48 -0500 Subject: [PATCH] Add new "null" opmode which doesn't mutate the file. --- src/opts.h | 1 + src/zzuf.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/opts.h b/src/opts.h index 619e1ed..28b4ddd 100644 --- a/src/opts.h +++ b/src/opts.h @@ -59,6 +59,7 @@ struct zzuf_opts { OPMODE_PRELOAD, OPMODE_COPY, + OPMODE_NULL, } opmode; char **oldargv; int oldargc; diff --git a/src/zzuf.c b/src/zzuf.c index c46b84b..f132889 100644 --- a/src/zzuf.c +++ b/src/zzuf.c @@ -307,6 +307,8 @@ int main(int argc, char *argv[]) opts->opmode = OPMODE_PRELOAD; else if (!strcmp(zz_optarg, "copy")) opts->opmode = OPMODE_COPY; + else if (!strcmp(zz_optarg, "null")) + opts->opmode = OPMODE_NULL; else { fprintf(stderr, "%s: invalid operating mode -- `%s'\n", @@ -1278,7 +1280,7 @@ static void usage(void) printf(" -M, --max-memory maximum child virtual memory in MiB (default %u)\n", DEFAULT_MEM); #endif printf(" -n, --network fuzz network input\n"); - printf(" -O, --opmode use operating mode ([preload] copy)\n"); + printf(" -O, --opmode use operating mode ([preload] copy null)\n"); printf(" -p, --ports only fuzz network destination ports in \n"); printf(" -P, --protect protect bytes and characters in \n"); printf(" -q, --quiet do not print children's messages\n");