Changeset 2583
- Timestamp:
- Jul 24, 2008, 1:40:06 AM (15 years ago)
- Location:
- zzuf/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/doc/zzuf.1
r2521 r2583 58 58 .TP 59 59 \fB\-B\fR, \fB\-\-max\-bytes\fR=\fIn\fR 60 Automatically terminate child processes that output more than \fIn\fR bytes 61 on the standard output and standard error channels. This is useful to detect 62 infinite loops. See also the \fB\-t\fR and \fB\-T\fR flags. 60 Automatically stop after \fIn\fR bytes have been output. 61 62 This either terminates child processes that output more than \fIn\fR bytes 63 on the standard output and standard error channels, or stop reading from 64 standard input if no program is being fuzzed. 65 66 This is useful to detect infinite loops. See also the \fB\-t\fR and \fB\-T\fR 67 flags. 63 68 .TP 64 69 \fB\-c\fR, \fB\-\-cmdline\fR -
zzuf/trunk/src/zzuf.c
r2555 r2583 471 471 uint8_t md5sum[16]; 472 472 struct md5 *ctx = NULL; 473 int total = 0; 473 474 474 475 if(opts->md5) … … 494 495 { 495 496 uint8_t buf[BUFSIZ]; 496 int ret, off = 0, nw = 0; 497 498 ret = read(0, buf, BUFSIZ); 497 int ret, toread = BUFSIZ, off = 0, nw = 0; 498 499 if(opts->maxbytes >= 0) 500 { 501 if(total >= opts->maxbytes) 502 break; 503 if(total + BUFSIZ >= opts->maxbytes) 504 toread = opts->maxbytes - total; 505 } 506 507 ret = read(0, buf, toread); 499 508 if(ret <= 0) 500 509 break; 510 511 total += ret; 501 512 502 513 _zz_fuzz(0, buf, ret);
Note: See TracChangeset
for help on using the changeset viewer.