From: Paul Cruz Date: Wed, 14 Jun 2017 19:04:22 +0000 (-0700) Subject: added error message to catch case where size not given X-Git-Tag: v1.3.0~1^2~15^2~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b0e24c06be1f7ac25f1410831baa848d0f012d3;p=thirdparty%2Fzstd.git added error message to catch case where size not given --- diff --git a/tests/decodecorpus.c b/tests/decodecorpus.c index 5a897cc4e..9bd6506e2 100644 --- a/tests/decodecorpus.c +++ b/tests/decodecorpus.c @@ -1326,12 +1326,15 @@ static int generateCorpusWithDict(U32 seed, unsigned numFiles, const char* const DISPLAY("Error: path too long\n"); return 1; } - + if(dictSize < 400){ + DISPLAY("Error: either no size given or given dictionary size is too small\n"); + return 1; + } /* Generate the dictionary randomly first */ dictContent = malloc(dictSize-400); dictID = RAND(&seed); fullDict = malloc(dictSize); - RAND_buffer(&seed, dictContent, dictSize-40); + RAND_buffer(&seed, dictContent, dictSize-400); { size_t dictWriteSize = 0;