diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2015-06-29 09:48:37 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2015-06-29 09:48:37 (GMT) |
commit | d86dc916771c126afb797637dda9f6421c0cb998 (patch) | |
tree | e6290359efd5d2e424b05f25a19b6ed3cee6e872 /programs/fuzzer.c | |
parent | db59c7d3321665a1d25f883ac7d80a2839fe22b9 (diff) | |
parent | dfabec2d1817e08fda70c19ed9248819b6a1fb22 (diff) | |
download | lz4-d86dc916771c126afb797637dda9f6421c0cb998.zip lz4-d86dc916771c126afb797637dda9f6421c0cb998.tar.gz lz4-d86dc916771c126afb797637dda9f6421c0cb998.tar.bz2 |
Merge pull request #131 from Cyan4973/devr131
Dev
Diffstat (limited to 'programs/fuzzer.c')
-rw-r--r-- | programs/fuzzer.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/programs/fuzzer.c b/programs/fuzzer.c index de12478..f1da1a8 100644 --- a/programs/fuzzer.c +++ b/programs/fuzzer.c @@ -208,12 +208,12 @@ static int FUZ_AddressOverflow(void) int i, nbBuff=0; int highAddress = 0; - printf("Overflow tests : "); + DISPLAY("Overflow tests : "); /* Only possible in 32-bits */ if (sizeof(void*)==8) { - printf("64 bits mode : no overflow \n"); + DISPLAY("64 bits mode : no overflow \n"); fflush(stdout); return 0; } @@ -222,23 +222,23 @@ static int FUZ_AddressOverflow(void) buffers[1] = (char*)malloc(BLOCKSIZE_I134); if ((!buffers[0]) || (!buffers[1])) { - printf("not enough memory for tests \n"); + DISPLAY("not enough memory for tests \n"); return 0; } + for (nbBuff=2; nbBuff < MAX_NB_BUFF_I134; nbBuff++) { - printf("%3i \b\b\b\b", nbBuff); + DISPLAY("%3i \b\b\b\b", nbBuff); buffers[nbBuff] = (char*)malloc(BLOCKSIZE_I134); - //printf("%08X ", (U32)(size_t)(buffers[nbBuff])); - fflush(stdout); + if (buffers[nbBuff]==NULL) goto _endOfTests; + //DISPLAY("%08X ", (U32)(size_t)(buffers[nbBuff])); fflush(stdout); if (((size_t)buffers[nbBuff] > (size_t)0x80000000) && (!highAddress)) { - printf("high address detected : "); + DISPLAY("high address detected : "); fflush(stdout); highAddress=1; } - if (buffers[nbBuff]==NULL) goto _endOfTests; { size_t sizeToGenerateOverflow = (size_t)(- ((size_t)buffers[nbBuff-1]) + 512); @@ -279,12 +279,12 @@ static int FUZ_AddressOverflow(void) nbBuff++; _endOfTests: for (i=0 ; i<nbBuff; i++) free(buffers[i]); - if (!highAddress) printf("high address not possible \n"); - else printf("all overflows correctly detected \n"); + if (!highAddress) DISPLAY("high address not possible \n"); + else DISPLAY("all overflows correctly detected \n"); return 0; _overflowError: - printf("Address space overflow error !! \n"); + DISPLAY("Address space overflow error !! \n"); exit(1); } |