Changeset 1633 for zzuf/trunk/src/zzuf.c
- Timestamp:
- Jan 9, 2007, 11:07:35 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/src/zzuf.c
r1632 r1633 78 78 static int endseed = 1; 79 79 static int quiet = 0; 80 static int max output= -1;80 static int maxbytes = -1; 81 81 static int md5 = 0; 82 82 static double maxtime = -1.0; … … 110 110 { 111 111 /* Long option, needs arg, flag, short option */ 112 { "max-bytes", 1, NULL, 'B' }, 112 113 { "cmdline", 0, NULL, 'c' }, 113 114 { "max-crashes", 1, NULL, 'C' }, … … 119 120 { "md5", 0, NULL, 'M' }, 120 121 { "network", 0, NULL, 'n' }, 121 { "max-output", 1, NULL, 'O' },122 122 { "protect", 1, NULL, 'P' }, 123 123 { "quiet", 0, NULL, 'q' }, … … 130 130 { "version", 0, NULL, 'v' }, 131 131 }; 132 int c = getopt_long(argc, argv, " cC:dE:F:iI:MnO:P:qr:R:s:ST:hv",132 int c = getopt_long(argc, argv, "B:cC:dE:F:iI:MnP:qr:R:s:ST:hv", 133 133 long_options, &option_index); 134 134 # else 135 135 # define MOREINFO "Try `%s -h' for more information.\n" 136 int c = getopt(argc, argv, " cC:dE:F:iI:MnO:P:qr:R:s:ST:hv");136 int c = getopt(argc, argv, "B:cC:dE:F:iI:MnP:qr:R:s:ST:hv"); 137 137 # endif 138 138 if(c == -1) … … 141 141 switch(c) 142 142 { 143 case 'B': /* --max-bytes */ 144 maxbytes = atoi(optarg); 145 break; 143 146 case 'c': /* --cmdline */ 144 147 cmdline = 1; … … 179 182 case 'n': /* --network */ 180 183 setenv("ZZUF_NETWORK", "1", 1); 181 break;182 case 'O': /* --max-output */183 maxoutput = atoi(optarg);184 184 break; 185 185 case 'P': /* --protect */ … … 466 466 { 467 467 if(child_list[i].status == STATUS_RUNNING 468 && max output >= 0 && child_list[i].bytes > maxoutput)468 && maxbytes >= 0 && child_list[i].bytes > maxbytes) 469 469 { 470 470 fprintf(stdout, "zzuf[seed=%i]: data exceeded, sending SIGTERM\n", … … 675 675 printf("Mandatory arguments to long options are mandatory for short options too.\n"); 676 676 # ifdef HAVE_GETOPT_LONG 677 printf(" -B, --max-bytes <n> kill children that output more than <n> bytes\n"); 677 678 printf(" -c, --cmdline only fuzz files specified in the command line\n"); 678 679 printf(" -C, --max-crashes <n> stop after <n> children have crashed (default 1)\n"); … … 684 685 printf(" -M, --md5 compute the output's MD5 hash\n"); 685 686 printf(" -n, --network fuzz network input\n"); 686 printf(" -O, --max-output <n> kill children that output more than <n> bytes\n");687 687 printf(" -P, --protect <list> protect bytes and characters in <list>\n"); 688 688 printf(" -q, --quiet do not print children's messages\n"); … … 696 696 printf(" -v, --version output version information and exit\n"); 697 697 # else 698 printf(" -B <n> kill children that output more than <n> bytes\n"); 698 699 printf(" -c only fuzz files specified in the command line\n"); 699 700 printf(" -C <n> stop after <n> children have crashed (default 1)\n"); … … 705 706 printf(" -M compute the output's MD5 hash\n"); 706 707 printf(" -n fuzz network input\n"); 707 printf(" -O <n> kill children that output more than <n> bytes\n");708 708 printf(" -P <list> protect bytes and characters in <list>\n"); 709 709 printf(" -q do not print the fuzzed application's messages\n");
Note: See TracChangeset
for help on using the changeset viewer.