From 3bd75df7c1a35ca548842f9585b57c71a71e2d76 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 28 Mar 2021 20:55:52 -0400 Subject: [PATCH] Add write test and more transformations in fuzz function. --- cups/fuzzipp.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cups/fuzzipp.c b/cups/fuzzipp.c index 9ad7537b4e..ffdb3485ce 100644 --- a/cups/fuzzipp.c +++ b/cups/fuzzipp.c @@ -187,8 +187,20 @@ main(int argc, // I - Number of command-line arguments } while (state == IPP_STATE_ATTRIBUTE); - ippDelete(request); cupsFileClose(fp); + + fp = cupsFileOpen("/dev/null", "w"); + + ippSetState(request, IPP_STATE_IDLE); + + do + { + state = ippWriteIO(fp, (ipp_iocb_t)cupsFileWrite, 1, NULL, request); + } + while (state == IPP_STATE_ATTRIBUTE); + + cupsFileClose(fp); + ippDelete(request); } return (0); @@ -210,7 +222,7 @@ fuzzdata(_ippdata_t *data) // I - Data buffer // Mutate a few times... - for (i = 0; i < 10; i ++) + for (i = 0; i < 32; i ++) { // Each cycle remove or move bytes switch (CUPS_RAND() & 7) -- 2.47.2