Merge pull request #11 from CERTCC-Vulnerability-Analysis/feature/add_opmode_null_to_run_without_fuzzing

Add new "null" opmode which doesn't mutate the file.
This commit is contained in:
Sam Hocevar 2016-02-03 20:36:17 +01:00
commit cc872b8062
2 changed files with 4 additions and 1 deletions

View File

@ -59,6 +59,7 @@ struct zzuf_opts
{ {
OPMODE_PRELOAD, OPMODE_PRELOAD,
OPMODE_COPY, OPMODE_COPY,
OPMODE_NULL,
} opmode; } opmode;
char **oldargv; char **oldargv;
int oldargc; int oldargc;

View File

@ -307,6 +307,8 @@ int main(int argc, char *argv[])
opts->opmode = OPMODE_PRELOAD; opts->opmode = OPMODE_PRELOAD;
else if (!strcmp(zz_optarg, "copy")) else if (!strcmp(zz_optarg, "copy"))
opts->opmode = OPMODE_COPY; opts->opmode = OPMODE_COPY;
else if (!strcmp(zz_optarg, "null"))
opts->opmode = OPMODE_NULL;
else else
{ {
fprintf(stderr, "%s: invalid operating mode -- `%s'\n", fprintf(stderr, "%s: invalid operating mode -- `%s'\n",
@ -1278,7 +1280,7 @@ static void usage(void)
printf(" -M, --max-memory <n> maximum child virtual memory in MiB (default %u)\n", DEFAULT_MEM); printf(" -M, --max-memory <n> maximum child virtual memory in MiB (default %u)\n", DEFAULT_MEM);
#endif #endif
printf(" -n, --network fuzz network input\n"); printf(" -n, --network fuzz network input\n");
printf(" -O, --opmode <mode> use operating mode <mode> ([preload] copy)\n"); printf(" -O, --opmode <mode> use operating mode <mode> ([preload] copy null)\n");
printf(" -p, --ports <list> only fuzz network destination ports in <list>\n"); printf(" -p, --ports <list> only fuzz network destination ports in <list>\n");
printf(" -P, --protect <list> protect bytes and characters in <list>\n"); printf(" -P, --protect <list> protect bytes and characters in <list>\n");
printf(" -q, --quiet do not print children's messages\n"); printf(" -q, --quiet do not print children's messages\n");