summaryrefslogtreecommitdiffstats
path: root/programs/fuzzer.c
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-06-22 10:25:04 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-06-22 10:25:04 (GMT)
commitda5373197e84ee49d75b8334d4510689731d6e90 (patch)
tree991ff0ab40b967176ba425db19619d00a70a85d7 /programs/fuzzer.c
parent8d66dd7cd52c69d4542eb910bd8743ef95fa9d8c (diff)
downloadlz4-da5373197e84ee49d75b8334d4510689731d6e90.zip
lz4-da5373197e84ee49d75b8334d4510689731d6e90.tar.gz
lz4-da5373197e84ee49d75b8334d4510689731d6e90.tar.bz2
Fixed : issue 52 (reported by Ludwig Strigeus)
Diffstat (limited to 'programs/fuzzer.c')
-rw-r--r--programs/fuzzer.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/programs/fuzzer.c b/programs/fuzzer.c
index dbf6c2f..82f6090 100644
--- a/programs/fuzzer.c
+++ b/programs/fuzzer.c
@@ -121,7 +121,7 @@ unsigned int FUZ_rand(unsigned int* src)
rand32 += PRIME2;
rand32 = FUZ_rotl32(rand32, 13);
*src = rand32;
- return rand32;
+ return rand32 >> 3;
}
@@ -170,7 +170,8 @@ int FUZ_SecurityTest()
char* input;
int i, r;
- printf("Overflow test (issue 52)...\n");
+ // Overflow test, by Ludwig Strigeus
+ printf("Overflow test (issue 52)...");
input = (char*) malloc (20<<20);
output = (char*) malloc (20<<20);
input[0] = 0x0F;
@@ -564,7 +565,6 @@ int FUZ_usage()
int main(int argc, char** argv) {
- char userInput[50] = {0};
U32 timestamp = FUZ_GetMilliStart();
U32 seed=0;
int seedset=0;
@@ -651,6 +651,7 @@ int main(int argc, char** argv) {
if (!seedset)
{
+ char userInput[50] = {0};
printf("Select an Initialisation number (default : random) : ");
fflush(stdout);
if ( no_prompt || fgets(userInput, sizeof userInput, stdin) )
@@ -662,7 +663,7 @@ int main(int argc, char** argv) {
printf("Seed = %u\n", seed);
if (proba!=FUZ_COMPRESSIBILITY_DEFAULT) printf("Compressibility : %i%%\n", proba);
- //FUZ_SecurityTest();
+ FUZ_SecurityTest();
if (nbTests<=0) nbTests=1;