Newly introduced findings

List of Findings

Error: COMPILER_WARNING (CWE-9001): [#def1]
zstd-1.5.7/contrib/gen_html/gen_html.cpp:128:29: warning[-Wcomment]: ‘/*’ within comment
#  128 |         /* comments of type /**< and /*!< are detected and only function declaration is highlighted (bold) */
#  126|           }
#  127|   
#  128|->         /* comments of type /**< and /*!< are detected and only function declaration is highlighted (bold) */
#  129|           if ((line.find("/**<")!=string::npos || line.find("/*!<")!=string::npos) && line.find("*/")!=string::npos) {
#  130|               sout << "<pre><b>";

Error: COMPILER_WARNING (CWE-9001): [#def2]
zstd-1.5.7/contrib/gen_html/gen_html.cpp:128:38: warning[-Wcomment]: ‘/*’ within comment
#  126|           }
#  127|   
#  128|->         /* comments of type /**< and /*!< are detected and only function declaration is highlighted (bold) */
#  129|           if ((line.find("/**<")!=string::npos || line.find("/*!<")!=string::npos) && line.find("*/")!=string::npos) {
#  130|               sout << "<pre><b>";

Error: COMPILER_WARNING (CWE-9001): [#def3]
zstd-1.5.7/contrib/gen_html/gen_html.cpp:162:29: warning[-Wcomment]: ‘/*’ within comment
#  162 |         /* comments of type /*! mean: this is a function declaration; switch comments with declarations */
#  160|           while (!comments.empty() && comments[0].empty()) comments.erase(comments.begin()); // remove empty line at the start
#  161|   
#  162|->         /* comments of type /*! mean: this is a function declaration; switch comments with declarations */
#  163|           if (exclam == '!') {
#  164|               if (!comments.empty()) comments.erase(comments.begin()); /* remove first line like "ZSTD_XXX() :" */

Error: COMPILER_WARNING (CWE-9001): [#def4]
zstd-1.5.7/contrib/gen_html/gen_html.cpp:182:57: warning[-Wcomment]: ‘/*’ within comment
#  182 |         } else if (exclam == '=') { /* comments of type /*= and /**= mean: use a <H3> header and show also all functions until first empty line */
#  180|               }
#  181|               sout << "</p></pre><BR>" << endl << endl;
#  182|->         } else if (exclam == '=') { /* comments of type /*= and /**= mean: use a <H3> header and show also all functions until first empty line */
#  183|               trim(comments[0], " ");
#  184|               sout << "<h3>" << comments[0] << "</h3><pre>";

Error: COMPILER_WARNING (CWE-9001): [#def5]
zstd-1.5.7/contrib/gen_html/gen_html.cpp:182:65: warning[-Wcomment]: ‘/*’ within comment
#  180|               }
#  181|               sout << "</p></pre><BR>" << endl << endl;
#  182|->         } else if (exclam == '=') { /* comments of type /*= and /**= mean: use a <H3> header and show also all functions until first empty line */
#  183|               trim(comments[0], " ");
#  184|               sout << "<h3>" << comments[0] << "</h3><pre>";

Error: COMPILER_WARNING (CWE-9001): [#def6]
zstd-1.5.7/contrib/gen_html/gen_html.cpp:194:38: warning[-Wcomment]: ‘/*’ within comment
#  194 |         } else { /* comments of type /** and /*- mean: this is a comment; use a <H2> header for the first line */
#  192|               }
#  193|               sout << "</pre></b><BR>" << endl;
#  194|->         } else { /* comments of type /** and /*- mean: this is a comment; use a <H2> header for the first line */
#  195|               if (comments.empty()) continue;
#  196|   

Error: COMPILER_WARNING (CWE-9001): [#def7]
zstd-1.5.7/contrib/gen_html/gen_html.cpp:194:46: warning[-Wcomment]: ‘/*’ within comment
#  192|               }
#  193|               sout << "</pre></b><BR>" << endl;
#  194|->         } else { /* comments of type /** and /*- mean: this is a comment; use a <H2> header for the first line */
#  195|               if (comments.empty()) continue;
#  196|   

Error: COMPILER_WARNING (CWE-457): [#def8]
zstd-1.5.7/lib/legacy/zstd_v01.c:1496:5: warning[-Wmaybe-uninitialized]: ‘MEM <unsigned int> [(struct  *)&litbp]’ may be used uninitialized
# 1496 |     switch(litbp.blockType)
#      |     ^~~~~~
zstd-1.5.7/lib/legacy/zstd_v01.c: scope_hint: In function ‘ZSTD_decompressBlock’
zstd-1.5.7/lib/legacy/zstd_v01.c:1489:23: note: ‘MEM <unsigned int> [(struct  *)&litbp]’ was declared here
# 1489 |     blockProperties_t litbp;
#      |                       ^~~~~
# 1494|       ip += ZSTD_blockHeaderSize;
# 1495|   
# 1496|->     switch(litbp.blockType)
# 1497|       {
# 1498|       case bt_raw:

Error: COMPILER_WARNING (CWE-457): [#def9]
zstd-1.5.7/lib/legacy/zstd_v01.c:1505:20: warning[-Wmaybe-uninitialized]: ‘litbp.origSize’ may be used uninitialized
# 1505 |             size_t rleSize = litbp.origSize;
#      |                    ^~~~~~~
zstd-1.5.7/lib/legacy/zstd_v01.c: scope_hint: In function ‘ZSTD_decompressBlock’
zstd-1.5.7/lib/legacy/zstd_v01.c:1489:23: note: ‘litbp.origSize’ was declared here
# 1489 |     blockProperties_t litbp;
#      |                       ^~~~~
# 1503|       case bt_rle:
# 1504|           {
# 1505|->             size_t rleSize = litbp.origSize;
# 1506|               if (rleSize>maxDstSize) return ERROR(dstSize_tooSmall);
# 1507|               if (!srcSize) return ERROR(srcSize_wrong);

Error: COMPILER_WARNING (CWE-457): [#def10]
zstd-1.5.7/lib/legacy/zstd_v01.c:1850:35: warning[-Wmaybe-uninitialized]: ‘dumpsLength’ may be used uninitialized
# 1850 |         seqState.dumpsEnd = dumps + dumpsLength;
#      |                             ~~~~~~^~~~~~~~~~~~~
zstd-1.5.7/lib/legacy/zstd_v01.c: scope_hint: In function ‘ZSTD_decompressBlock’
zstd-1.5.7/lib/legacy/zstd_v01.c:1826:23: note: ‘dumpsLength’ was declared here
# 1826 |     size_t errorCode, dumpsLength;
#      |                       ^~~~~~~~~~~
# 1848|           memset(&sequence, 0, sizeof(sequence));
# 1849|           seqState.dumps = dumps;
# 1850|->         seqState.dumpsEnd = dumps + dumpsLength;
# 1851|           seqState.prevOffset = 1;
# 1852|           errorCode = FSE_initDStream(&(seqState.DStream), ip, iend-ip);

Error: COMPILER_WARNING (CWE-457): [#def11]
zstd-1.5.7/lib/legacy/zstd_v01.c:1850:35: warning[-Wmaybe-uninitialized]: ‘dumps’ may be used uninitialized
# 1850 |         seqState.dumpsEnd = dumps + dumpsLength;
#      |                             ~~~~~~^~~~~~~~~~~~~
zstd-1.5.7/lib/legacy/zstd_v01.c: scope_hint: In function ‘ZSTD_decompressBlock’
zstd-1.5.7/lib/legacy/zstd_v01.c:1830:17: note: ‘dumps’ was declared here
# 1830 |     const BYTE* dumps;
#      |                 ^~~~~
# 1848|           memset(&sequence, 0, sizeof(sequence));
# 1849|           seqState.dumps = dumps;
# 1850|->         seqState.dumpsEnd = dumps + dumpsLength;
# 1851|           seqState.prevOffset = 1;
# 1852|           errorCode = FSE_initDStream(&(seqState.DStream), ip, iend-ip);

Error: COMPILER_WARNING (CWE-457): [#def12]
zstd-1.5.7/lib/legacy/zstd_v01.c:1858:83: warning[-Wmaybe-uninitialized]: ‘nbSeq’ may be used uninitialized
# 1858 |         for ( ; (FSE_reloadDStream(&(seqState.DStream)) <= FSE_DStream_completed) && (nbSeq>0) ; )
#      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
zstd-1.5.7/lib/legacy/zstd_v01.c: scope_hint: In function ‘ZSTD_decompressBlock’
zstd-1.5.7/lib/legacy/zstd_v01.c:1829:9: note: ‘nbSeq’ was declared here
# 1829 |     int nbSeq;
#      |         ^~~~~
# 1856|           FSE_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
# 1857|   
# 1858|->         for ( ; (FSE_reloadDStream(&(seqState.DStream)) <= FSE_DStream_completed) && (nbSeq>0) ; )
# 1859|           {
# 1860|               size_t oneSeqSize;

Error: COMPILER_WARNING (CWE-457): [#def13]
zstd-1.5.7/lib/legacy/zstd_v01.c: scope_hint: In function ‘ZSTDv01_decompressDCtx’
zstd-1.5.7/lib/legacy/zstd_v01.c:1936:9: warning[-Wmaybe-uninitialized]: ‘MEM <unsigned int> [(struct  *)&blockProperties]’ may be used uninitialized
# 1936 |         switch(blockProperties.blockType)
#      |         ^~~~~~
zstd-1.5.7/lib/legacy/zstd_v01.c:1918:23: note: ‘MEM <unsigned int> [(struct  *)&blockProperties]’ was declared here
# 1918 |     blockProperties_t blockProperties;
#      |                       ^~~~~~~~~~~~~~~
# 1934|           if (blockSize > remainingSize) return ERROR(srcSize_wrong);
# 1935|   
# 1936|->         switch(blockProperties.blockType)
# 1937|           {
# 1938|           case bt_compressed:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
zstd-1.5.7/programs/fileio_asyncio.c:173:27: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
zstd-1.5.7/programs/fileio_asyncio.c:547:16: enter_function: entry to ‘AIO_ReadPool_create’
zstd-1.5.7/programs/fileio_asyncio.c:548:49: acquire_memory: allocated here
zstd-1.5.7/programs/fileio_asyncio.c:549:7: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
zstd-1.5.7/programs/fileio_asyncio.c:550:5: branch_false: ...to here
zstd-1.5.7/programs/fileio_asyncio.c:550:5: call_function: calling ‘AIO_IOPool_init’ from ‘AIO_ReadPool_create’
#  171|            * decompress into and 1 buffer that's actively written to disk and owned by the writing thread. */
#  172|           assert(MAX_IO_JOBS >= 2);
#  173|->         ctx->threadPool = POOL_create(1, MAX_IO_JOBS - 2);
#  174|           ctx->threadPoolActive = 1;
#  175|           if (!ctx->threadPool)

Error: COMPILER_WARNING (CWE-457): [#def15]
zstd-1.5.7/tests/fullbench.c: scope_hint: In function ‘prepLiterals’
zstd-1.5.7/tests/fullbench.c:189:12: warning[-Wmaybe-uninitialized]: ‘MEM <unsigned int> [(struct  *)&bp]’ may be used uninitialized
#  189 |         if (bp.blockType != bt_compressed) {
#      |            ^
zstd-1.5.7/tests/fullbench.c:187:27: note: ‘MEM <unsigned int> [(struct  *)&bp]’ was declared here
#  187 |     {   blockProperties_t bp;
#      |                           ^
#  187|       {   blockProperties_t bp;
#  188|           ZSTD_getcBlockSize((char*)dst+frameHeaderSize, dstCapacity, &bp);  /* Get 1st block type */
#  189|->         if (bp.blockType != bt_compressed) {
#  190|               DISPLAY("no compressed literals\n");
#  191|               return r;

Error: COMPILER_WARNING (CWE-457): [#def16]
zstd-1.5.7/tests/fullbench.c: scope_hint: In function ‘prepSequences1stBlock’
zstd-1.5.7/tests/fullbench.c:297:12: warning[-Wmaybe-uninitialized]: ‘MEM <unsigned int> [(struct  *)&bp]’ may be used uninitialized
#  297 |         if (bp.blockType != bt_compressed) {
#      |            ^
zstd-1.5.7/tests/fullbench.c:295:27: note: ‘MEM <unsigned int> [(struct  *)&bp]’ was declared here
#  295 |     {   blockProperties_t bp;
#      |                           ^
#  295|       {   blockProperties_t bp;
#  296|           size_t const cBlockSize = ZSTD_getcBlockSize(ip, dstCapacity, &bp);   /* Get 1st block type */
#  297|->         if (bp.blockType != bt_compressed) {
#  298|               DISPLAY("no compressed sequences\n");
#  299|               return r;

Error: CPPCHECK_WARNING (CWE-682): [#def17]
zstd-1.5.7/tests/fullbench.c:537: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  535|       size_t const prepCapacity = dstCapacity * 4;
#  536|       void* prepBuffer = malloc(prepCapacity);
#  537|->     void* sequencesStart = (char*)prepBuffer + 2*sizeof(unsigned);
#  538|       ZSTD_Sequence* const seqs = sequencesStart;
#  539|       size_t const seqsCapacity = prepCapacity / sizeof(ZSTD_Sequence);

Error: CPPCHECK_WARNING (CWE-682): [#def18]
zstd-1.5.7/tests/fullbench.c:579: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  577|       size_t const prepCapacity = dstCapacity * 4;
#  578|       void* prepBuffer = malloc(prepCapacity);
#  579|->     void* sequencesStart = (char*)prepBuffer + 3*sizeof(unsigned);
#  580|       ZSTD_Sequence* const seqs = sequencesStart;
#  581|       size_t const seqsCapacity = prepCapacity / sizeof(ZSTD_Sequence);

Error: CPPCHECK_WARNING (CWE-682): [#def19]
zstd-1.5.7/tests/fullbench.c:636: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  634|       size_t const prepCapacity = srcSize * 4;
#  635|       void* prepBuffer = malloc(prepCapacity);
#  636|->     void* sequencesStart = (char*)prepBuffer + 2*sizeof(unsigned);
#  637|       ZSTD_Sequence* const seqs = sequencesStart;
#  638|       size_t const seqsCapacity = prepCapacity / sizeof(ZSTD_Sequence);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
zstd-1.5.7/tests/fullbench.c:698:15: warning[-Wanalyzer-malloc-leak]: leak of ‘decompressed’
zstd-1.5.7/tests/fullbench.c:1104:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1118:19: branch_false: following ‘false’ branch (when ‘argNb >= argc’)...
zstd-1.5.7/tests/fullbench.c:1201:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1201:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/fullbench.c:1202:18: branch_true: ...to here
zstd-1.5.7/tests/fullbench.c:1202:18: call_function: calling ‘benchSample’ from ‘main’
#  696|       if (decompressed == NULL) return 2;
#  697|   
#  698|->     decSize = ZSTD_decompress(decompressed, origSize, compressed, cSize);
#  699|       if (decSize != origSize) { free(decompressed); DISPLAY("ZSTD_decompress failed (%u) ", (unsigned)decSize); return 1; }
#  700|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
zstd-1.5.7/tests/fullbench.c:736:21: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(srcSize)’
zstd-1.5.7/tests/fullbench.c:1104:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1118:19: branch_false: following ‘false’ branch (when ‘argNb >= argc’)...
zstd-1.5.7/tests/fullbench.c:1201:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1201:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/fullbench.c:1202:18: branch_true: ...to here
zstd-1.5.7/tests/fullbench.c:1202:18: call_function: calling ‘benchSample’ from ‘main’
#  734|       CONTROL(r.prepBuffer != NULL);
#  735|       memcpy(r.prepBuffer, src, srcSize);
#  736|->     r.dstCapacity = ZSTD_compressBound(srcSize);
#  737|       r.dst = malloc(r.dstCapacity);
#  738|       CONTROL(r.dst != NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
zstd-1.5.7/tests/fullbench.c:738:5: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(srcSize)’
zstd-1.5.7/tests/fullbench.c:1104:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1118:19: branch_false: following ‘false’ branch (when ‘argNb >= argc’)...
zstd-1.5.7/tests/fullbench.c:1201:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1201:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/fullbench.c:1202:18: branch_true: ...to here
zstd-1.5.7/tests/fullbench.c:1202:18: call_function: calling ‘benchSample’ from ‘main’
#  736|       r.dstCapacity = ZSTD_compressBound(srcSize);
#  737|       r.dst = malloc(r.dstCapacity);
#  738|->     CONTROL(r.dst != NULL);
#  739|       return r;
#  740|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
zstd-1.5.7/tests/fullbench.c:865:41: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
zstd-1.5.7/tests/fullbench.c:1104:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1118:19: branch_false: following ‘false’ branch (when ‘argNb >= argc’)...
zstd-1.5.7/tests/fullbench.c:1201:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1201:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/fullbench.c:1202:18: branch_true: ...to here
zstd-1.5.7/tests/fullbench.c:1202:18: call_function: calling ‘benchSample’ from ‘main’
#  863|   
#  864|       /* benchmark loop */
#  865|->     {   BMK_timedFnState_t* const tfs = BMK_createTimedFnState(g_nbIterations * 1000, 1000);
#  866|           void* const avoidStrictAliasingPtr = &dst;
#  867|           const void* prepSrc = prepBuff;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
zstd-1.5.7/tests/fullbench.c:865:41: warning[-Wanalyzer-malloc-leak]: leak of ‘prepBuff’
zstd-1.5.7/tests/fullbench.c:1104:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1118:19: branch_false: following ‘false’ branch (when ‘argNb >= argc’)...
zstd-1.5.7/tests/fullbench.c:1201:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1201:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/fullbench.c:1202:18: branch_true: ...to here
zstd-1.5.7/tests/fullbench.c:1202:18: call_function: calling ‘benchSample’ from ‘main’
#  863|   
#  864|       /* benchmark loop */
#  865|->     {   BMK_timedFnState_t* const tfs = BMK_createTimedFnState(g_nbIterations * 1000, 1000);
#  866|           void* const avoidStrictAliasingPtr = &dst;
#  867|           const void* prepSrc = prepBuff;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
zstd-1.5.7/tests/fullbench.c:888:47: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
zstd-1.5.7/tests/fullbench.c:1104:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1118:19: branch_false: following ‘false’ branch (when ‘argNb >= argc’)...
zstd-1.5.7/tests/fullbench.c:1201:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1201:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/fullbench.c:1202:18: branch_true: ...to here
zstd-1.5.7/tests/fullbench.c:1202:18: call_function: calling ‘benchSample’ from ‘main’
#  886|   
#  887|           for (;;) {
#  888|->             BMK_runOutcome_t const bOutcome = BMK_benchTimedFn(tfs, bp);
#  889|   
#  890|               if (!BMK_isSuccessful_runOutcome(bOutcome)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
zstd-1.5.7/tests/fullbench.c:888:47: warning[-Wanalyzer-malloc-leak]: leak of ‘prepBuff’
zstd-1.5.7/tests/fullbench.c:1104:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1118:19: branch_false: following ‘false’ branch (when ‘argNb >= argc’)...
zstd-1.5.7/tests/fullbench.c:1201:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1201:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/fullbench.c:1202:18: branch_true: ...to here
zstd-1.5.7/tests/fullbench.c:1202:18: call_function: calling ‘benchSample’ from ‘main’
#  886|   
#  887|           for (;;) {
#  888|->             BMK_runOutcome_t const bOutcome = BMK_benchTimedFn(tfs, bp);
#  889|   
#  890|               if (!BMK_isSuccessful_runOutcome(bOutcome)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
zstd-1.5.7/tests/fullbench.c:946:9: warning[-Wanalyzer-malloc-leak]: leak of ‘origBuff’
zstd-1.5.7/tests/fullbench.c:1104:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1118:19: branch_false: following ‘false’ branch (when ‘argNb >= argc’)...
zstd-1.5.7/tests/fullbench.c:1201:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1201:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/fullbench.c:1202:18: branch_true: ...to here
zstd-1.5.7/tests/fullbench.c:1202:18: call_function: calling ‘benchSample’ from ‘main’
#  944|       /* Fill buffer */
#  945|       if (compressibility < 0.0) {
#  946|->         LOREM_genBuffer(origBuff, benchedSize, 0);
#  947|       } else {
#  948|           RDG_genBuffer(origBuff, benchedSize, compressibility, 0.0, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
zstd-1.5.7/tests/fullbench.c:948:9: warning[-Wanalyzer-malloc-leak]: leak of ‘origBuff’
zstd-1.5.7/tests/fullbench.c:1104:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1118:19: branch_false: following ‘false’ branch (when ‘argNb >= argc’)...
zstd-1.5.7/tests/fullbench.c:1201:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1201:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/fullbench.c:1202:18: branch_true: ...to here
zstd-1.5.7/tests/fullbench.c:1202:18: call_function: calling ‘benchSample’ from ‘main’
#  946|           LOREM_genBuffer(origBuff, benchedSize, 0);
#  947|       } else {
#  948|->         RDG_genBuffer(origBuff, benchedSize, compressibility, 0.0, 0);
#  949|   
#  950|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def29]
zstd-1.5.7/tests/fullbench.c:983:36: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(inFileName, "rb")’
zstd-1.5.7/tests/fullbench.c:1104:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1118:19: branch_true: following ‘true’ branch (when ‘argNb < argc’)...
zstd-1.5.7/tests/fullbench.c:1119:36: branch_true: ...to here
zstd-1.5.7/tests/fullbench.c:1120:9: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/fullbench.c:1122:13: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1122:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/fullbench.c:1144:20: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1144:19: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/fullbench.c:1196:12: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1196:12: branch_true: following ‘true’ branch (when ‘input_filename’ is NULL)...
zstd-1.5.7/tests/fullbench.c:1196:12: branch_true: ...to here
zstd-1.5.7/tests/fullbench.c:1118:19: branch_false: following ‘false’ branch (when ‘argNb >= argc’)...
zstd-1.5.7/tests/fullbench.c:1201:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1201:8: branch_false: following ‘false’ branch (when ‘filenamesStart != 0’)...
zstd-1.5.7/tests/fullbench.c:1204:62: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1204:18: call_function: calling ‘benchFiles’ from ‘main’
#  981|   
#  982|           /* Memory allocation & restrictions */
#  983|->         {   U64 const inFileSize = UTIL_getFileSize(inFileName);
#  984|               if (inFileSize == UTIL_FILESIZE_UNKNOWN) {
#  985|                   DISPLAY( "Cannot measure size of %s\n", inFileName);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
zstd-1.5.7/tests/fullbench.c:983:36: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(inFileName, "rb")’
zstd-1.5.7/tests/fullbench.c:1104:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
zstd-1.5.7/tests/fullbench.c:1116:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1118:19: branch_true: following ‘true’ branch (when ‘argNb < argc’)...
zstd-1.5.7/tests/fullbench.c:1119:36: branch_true: ...to here
zstd-1.5.7/tests/fullbench.c:1120:9: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/fullbench.c:1122:13: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1122:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/fullbench.c:1144:20: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1144:19: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/fullbench.c:1196:12: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1196:12: branch_true: following ‘true’ branch (when ‘input_filename’ is NULL)...
zstd-1.5.7/tests/fullbench.c:1196:12: branch_true: ...to here
zstd-1.5.7/tests/fullbench.c:1118:19: branch_false: following ‘false’ branch (when ‘argNb >= argc’)...
zstd-1.5.7/tests/fullbench.c:1201:8: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1201:8: branch_false: following ‘false’ branch (when ‘filenamesStart != 0’)...
zstd-1.5.7/tests/fullbench.c:1204:62: branch_false: ...to here
zstd-1.5.7/tests/fullbench.c:1204:18: call_function: calling ‘benchFiles’ from ‘main’
#  981|   
#  982|           /* Memory allocation & restrictions */
#  983|->         {   U64 const inFileSize = UTIL_getFileSize(inFileName);
#  984|               if (inFileSize == UTIL_FILESIZE_UNKNOWN) {
#  985|                   DISPLAY( "Cannot measure size of %s\n", inFileName);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
zstd-1.5.7/tests/paramgrill.c:392:9: warning[-Wanalyzer-malloc-leak]: leak of ‘testmem’
zstd-1.5.7/tests/paramgrill.c:2362:1: enter_function: entry to ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2370:27: call_function: calling ‘variableParams’ from ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2370:27: return_function: returning to ‘optimizeForSize’ from ‘variableParams’
zstd-1.5.7/tests/paramgrill.c:2371:42: call_function: inlined call to ‘emptyParams’ from ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2378:9: call_function: calling ‘createBuffers’ from ‘optimizeForSize’
#  390|       while (!testmem && requiredMem > 0) {
#  391|           testmem = malloc ((size_t)requiredMem);
#  392|->         requiredMem -= step;
#  393|       }
#  394|   

Error: CPPCHECK_WARNING (CWE-628): [#def32]
zstd-1.5.7/tests/paramgrill.c:575: warning[invalidFunctionArg]: Invalid log() argument nr 1. The value is 0 but the valid values are '4.94066e-324:'.
#  573|   
#  574|       ret = (MIN(1, cs) + MIN(1, ds)  + MIN(1, cm))*r1 + rt * rtr +
#  575|->          (MAX(0, log(cs))+ MAX(0, log(ds))+ MAX(0, log(cm))) * r2;
#  576|   
#  577|       return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
zstd-1.5.7/tests/paramgrill.c:1197:31: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.dstCapacities’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1195|       buff->srcBuffer = srcBuffer;
# 1196|       buff->srcPtrs[0] = (const void*)buff->srcBuffer;
# 1197|->     buff->dstPtrs[0] = malloc(ZSTD_compressBound(buff->srcSize) + (maxNbBlocks * 1024));
# 1198|       buff->resPtrs[0] = malloc(buff->srcSize);
# 1199|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
zstd-1.5.7/tests/paramgrill.c:1197:31: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.dstPtrs’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1195|       buff->srcBuffer = srcBuffer;
# 1196|       buff->srcPtrs[0] = (const void*)buff->srcBuffer;
# 1197|->     buff->dstPtrs[0] = malloc(ZSTD_compressBound(buff->srcSize) + (maxNbBlocks * 1024));
# 1198|       buff->resPtrs[0] = malloc(buff->srcSize);
# 1199|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
zstd-1.5.7/tests/paramgrill.c:1197:31: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.dstSizes’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1195|       buff->srcBuffer = srcBuffer;
# 1196|       buff->srcPtrs[0] = (const void*)buff->srcBuffer;
# 1197|->     buff->dstPtrs[0] = malloc(ZSTD_compressBound(buff->srcSize) + (maxNbBlocks * 1024));
# 1198|       buff->resPtrs[0] = malloc(buff->srcSize);
# 1199|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
zstd-1.5.7/tests/paramgrill.c:1197:31: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.resPtrs’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1195|       buff->srcBuffer = srcBuffer;
# 1196|       buff->srcPtrs[0] = (const void*)buff->srcBuffer;
# 1197|->     buff->dstPtrs[0] = malloc(ZSTD_compressBound(buff->srcSize) + (maxNbBlocks * 1024));
# 1198|       buff->resPtrs[0] = malloc(buff->srcSize);
# 1199|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
zstd-1.5.7/tests/paramgrill.c:1197:31: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.resSizes’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1195|       buff->srcBuffer = srcBuffer;
# 1196|       buff->srcPtrs[0] = (const void*)buff->srcBuffer;
# 1197|->     buff->dstPtrs[0] = malloc(ZSTD_compressBound(buff->srcSize) + (maxNbBlocks * 1024));
# 1198|       buff->resPtrs[0] = malloc(buff->srcSize);
# 1199|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
zstd-1.5.7/tests/paramgrill.c:1197:31: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.srcPtrs’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1195|       buff->srcBuffer = srcBuffer;
# 1196|       buff->srcPtrs[0] = (const void*)buff->srcBuffer;
# 1197|->     buff->dstPtrs[0] = malloc(ZSTD_compressBound(buff->srcSize) + (maxNbBlocks * 1024));
# 1198|       buff->resPtrs[0] = malloc(buff->srcSize);
# 1199|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
zstd-1.5.7/tests/paramgrill.c:1197:31: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.srcSizes’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1195|       buff->srcBuffer = srcBuffer;
# 1196|       buff->srcPtrs[0] = (const void*)buff->srcBuffer;
# 1197|->     buff->dstPtrs[0] = malloc(ZSTD_compressBound(buff->srcSize) + (maxNbBlocks * 1024));
# 1198|       buff->resPtrs[0] = malloc(buff->srcSize);
# 1199|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
zstd-1.5.7/tests/paramgrill.c:1218:30: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1216|       }
# 1217|   
# 1218|->     buff->dstCapacities[0] = ZSTD_compressBound(buff->srcSizes[0]);
# 1219|       buff->dstSizes[0] = buff->dstCapacities[0];
# 1220|       buff->resSizes[0] = buff->srcSizes[0];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
zstd-1.5.7/tests/paramgrill.c:1218:30: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.dstCapacities’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1216|       }
# 1217|   
# 1218|->     buff->dstCapacities[0] = ZSTD_compressBound(buff->srcSizes[0]);
# 1219|       buff->dstSizes[0] = buff->dstCapacities[0];
# 1220|       buff->resSizes[0] = buff->srcSizes[0];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
zstd-1.5.7/tests/paramgrill.c:1218:30: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.dstPtrs’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1216|       }
# 1217|   
# 1218|->     buff->dstCapacities[0] = ZSTD_compressBound(buff->srcSizes[0]);
# 1219|       buff->dstSizes[0] = buff->dstCapacities[0];
# 1220|       buff->resSizes[0] = buff->srcSizes[0];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
zstd-1.5.7/tests/paramgrill.c:1218:30: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.dstSizes’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1216|       }
# 1217|   
# 1218|->     buff->dstCapacities[0] = ZSTD_compressBound(buff->srcSizes[0]);
# 1219|       buff->dstSizes[0] = buff->dstCapacities[0];
# 1220|       buff->resSizes[0] = buff->srcSizes[0];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
zstd-1.5.7/tests/paramgrill.c:1218:30: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.resPtrs’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1216|       }
# 1217|   
# 1218|->     buff->dstCapacities[0] = ZSTD_compressBound(buff->srcSizes[0]);
# 1219|       buff->dstSizes[0] = buff->dstCapacities[0];
# 1220|       buff->resSizes[0] = buff->srcSizes[0];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
zstd-1.5.7/tests/paramgrill.c:1218:30: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.resSizes’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1216|       }
# 1217|   
# 1218|->     buff->dstCapacities[0] = ZSTD_compressBound(buff->srcSizes[0]);
# 1219|       buff->dstSizes[0] = buff->dstCapacities[0];
# 1220|       buff->resSizes[0] = buff->srcSizes[0];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
zstd-1.5.7/tests/paramgrill.c:1218:30: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.srcPtrs’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1216|       }
# 1217|   
# 1218|->     buff->dstCapacities[0] = ZSTD_compressBound(buff->srcSizes[0]);
# 1219|       buff->dstSizes[0] = buff->dstCapacities[0];
# 1220|       buff->resSizes[0] = buff->srcSizes[0];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
zstd-1.5.7/tests/paramgrill.c:1218:30: warning[-Wanalyzer-malloc-leak]: leak of ‘buf.srcSizes’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 1216|       }
# 1217|   
# 1218|->     buff->dstCapacities[0] = ZSTD_compressBound(buff->srcSizes[0]);
# 1219|       buff->dstSizes[0] = buff->dstCapacities[0];
# 1220|       buff->resSizes[0] = buff->srcSizes[0];

Error: COMPILER_WARNING: [#def48]
zstd-1.5.7/tests/paramgrill.c: scope_hint: In function ‘createBuffers’
zstd-1.5.7/tests/paramgrill.c:1245:39: warning[-Wcalloc-transposed-args]: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument
# 1245 |     size_t* fileSizes = calloc(sizeof(size_t), nbFiles);
#      |                                       ^~~~~~
zstd-1.5.7/tests/paramgrill.c:1245:39: note: earlier argument should specify number of elements, later size of each element
# 1243|       size_t totalSizeToLoad = (size_t)UTIL_getTotalFileSize(fileNamesTable, (U32)nbFiles);
# 1244|       size_t benchedSize = MIN(BMK_findMaxMem(totalSizeToLoad * 3) / 3, totalSizeToLoad);
# 1245|->     size_t* fileSizes = calloc(sizeof(size_t), nbFiles);
# 1246|       void* srcBuffer = NULL;
# 1247|       int ret = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
zstd-1.5.7/tests/paramgrill.c:1264:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fileSizes’
zstd-1.5.7/tests/paramgrill.c:2362:1: enter_function: entry to ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2370:27: call_function: calling ‘variableParams’ from ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2370:27: return_function: returning to ‘optimizeForSize’ from ‘variableParams’
zstd-1.5.7/tests/paramgrill.c:2371:42: call_function: inlined call to ‘emptyParams’ from ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2378:9: call_function: calling ‘createBuffers’ from ‘optimizeForSize’
# 1262|       for(n = 0; n < nbFiles; n++) {
# 1263|           FILE* f;
# 1264|->         U64 fileSize = UTIL_getFileSize(fileNamesTable[n]);
# 1265|           if (UTIL_isDirectory(fileNamesTable[n])) {
# 1266|               DISPLAY("Ignoring %s directory...       \n", fileNamesTable[n]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
zstd-1.5.7/tests/paramgrill.c:1264:24: warning[-Wanalyzer-malloc-leak]: leak of ‘srcBuffer’
zstd-1.5.7/tests/paramgrill.c:2362:1: enter_function: entry to ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2370:27: call_function: calling ‘variableParams’ from ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2370:27: return_function: returning to ‘optimizeForSize’ from ‘variableParams’
zstd-1.5.7/tests/paramgrill.c:2371:42: call_function: inlined call to ‘emptyParams’ from ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2378:9: call_function: calling ‘createBuffers’ from ‘optimizeForSize’
# 1262|       for(n = 0; n < nbFiles; n++) {
# 1263|           FILE* f;
# 1264|->         U64 fileSize = UTIL_getFileSize(fileNamesTable[n]);
# 1265|           if (UTIL_isDirectory(fileNamesTable[n])) {
# 1266|               DISPLAY("Ignoring %s directory...       \n", fileNamesTable[n]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
zstd-1.5.7/tests/paramgrill.c:1265:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fileSizes’
zstd-1.5.7/tests/paramgrill.c:2362:1: enter_function: entry to ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2370:27: call_function: calling ‘variableParams’ from ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2370:27: return_function: returning to ‘optimizeForSize’ from ‘variableParams’
zstd-1.5.7/tests/paramgrill.c:2371:42: call_function: inlined call to ‘emptyParams’ from ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2378:9: call_function: calling ‘createBuffers’ from ‘optimizeForSize’
# 1263|           FILE* f;
# 1264|           U64 fileSize = UTIL_getFileSize(fileNamesTable[n]);
# 1265|->         if (UTIL_isDirectory(fileNamesTable[n])) {
# 1266|               DISPLAY("Ignoring %s directory...       \n", fileNamesTable[n]);
# 1267|               continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
zstd-1.5.7/tests/paramgrill.c:1265:13: warning[-Wanalyzer-malloc-leak]: leak of ‘srcBuffer’
zstd-1.5.7/tests/paramgrill.c:2362:1: enter_function: entry to ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2370:27: call_function: calling ‘variableParams’ from ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2370:27: return_function: returning to ‘optimizeForSize’ from ‘variableParams’
zstd-1.5.7/tests/paramgrill.c:2371:42: call_function: inlined call to ‘emptyParams’ from ‘optimizeForSize’
zstd-1.5.7/tests/paramgrill.c:2378:9: call_function: calling ‘createBuffers’ from ‘optimizeForSize’
# 1263|           FILE* f;
# 1264|           U64 fileSize = UTIL_getFileSize(fileNamesTable[n]);
# 1265|->         if (UTIL_isDirectory(fileNamesTable[n])) {
# 1266|               DISPLAY("Ignoring %s directory...       \n", fileNamesTable[n]);
# 1267|               continue;

Error: COMPILER_WARNING: [#def53]
zstd-1.5.7/tests/paramgrill.c: scope_hint: In function ‘createMemoTableArray’
zstd-1.5.7/tests/paramgrill.c:1460:60: warning[-Wcalloc-transposed-args]: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument
# 1460 |     memoTable_t* const mtAll = (memoTable_t*)calloc(sizeof(memoTable_t),(ZSTD_STRATEGY_MAX + 1));
#      |                                                            ^~~~~~~~~~~
zstd-1.5.7/tests/paramgrill.c:1460:60: note: earlier argument should specify number of elements, later size of each element
# 1458|                        const U32 memoTableLog)
# 1459|   {
# 1460|->     memoTable_t* const mtAll = (memoTable_t*)calloc(sizeof(memoTable_t),(ZSTD_STRATEGY_MAX + 1));
# 1461|       ZSTD_strategy i, stratMin = ZSTD_STRATEGY_MIN, stratMax = ZSTD_STRATEGY_MAX;
# 1462|   

Error: COMPILER_WARNING: [#def54]
zstd-1.5.7/tests/paramgrill.c:1497:47: warning[-Wcalloc-transposed-args]: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument
# 1497 |         mtAll[i].table = (BYTE*)calloc(sizeof(BYTE), mtl);
#      |                                               ^~~~
zstd-1.5.7/tests/paramgrill.c:1497:47: note: earlier argument should specify number of elements, later size of each element
# 1495|           }
# 1496|   
# 1497|->         mtAll[i].table = (BYTE*)calloc(sizeof(BYTE), mtl);
# 1498|           mtAll[i].tableLen = mtl;
# 1499|   

Error: COMPILER_WARNING (CWE-457): [#def55]
zstd-1.5.7/tests/paramgrill.c: scope_hint: In function ‘BMK_generate_cLevelTable’
zstd-1.5.7/tests/paramgrill.c:2018:61: warning[-Wmaybe-uninitialized]: ‘testResult.cSpeed’ may be used uninitialized
# 2018 |         BMK_init_level_constraints((int)((testResult.cSpeed * 31) / 32));
#      |                                                             ^
zstd-1.5.7/tests/paramgrill.c:2016:27: note: ‘testResult.cSpeed’ was declared here
# 2016 |         BMK_benchResult_t testResult;
#      |                           ^
# 2016|           BMK_benchResult_t testResult;
# 2017|           BMK_benchParam(&testResult, buf, ctx, l1params);
# 2018|->         BMK_init_level_constraints((int)((testResult.cSpeed * 31) / 32));
# 2019|       }
# 2020|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
zstd-1.5.7/tests/paramgrill.c:2081:5: warning[-Wanalyzer-malloc-leak]: leak of ‘srcBuffer’
zstd-1.5.7/tests/paramgrill.c:2699:5: enter_function: entry to ‘main’
zstd-1.5.7/tests/paramgrill.c:2714:33: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2715:16: call_function: inlined call to ‘emptyParams’ from ‘main’
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: following ‘true’ branch...
zstd-1.5.7/tests/paramgrill.c:2932:5: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2934:8: branch_true: following ‘true’ branch (when ‘filenamesStart == 0’)...
zstd-1.5.7/tests/paramgrill.c:2935:13: branch_true: ...to here
zstd-1.5.7/tests/paramgrill.c:2935:12: branch_false: following ‘false’ branch...
zstd-1.5.7/tests/paramgrill.c:2939:22: branch_false: ...to here
zstd-1.5.7/tests/paramgrill.c:2939:22: call_function: calling ‘benchSample’ from ‘main’
# 2079|       }
# 2080|   
# 2081|->     RDG_genBuffer(srcBuffer, benchedSize, compressibility, 0.0, 0);
# 2082|   
# 2083|       if(createBuffersFromMemory(&buf, srcBuffer, 1, &benchedSize)) {

Error: CPPCHECK_WARNING (CWE-457): [#def57]
zstd-1.5.7/tests/seqgen.c:38: error[uninitvar]: Uninitialized variables: stream.saved, stream.bytesLeft
#   36|       XXH64_reset(&stream.xxh, 0);
#   37|       stream.seed = seed;
#   38|->     return stream;
#   39|   }
#   40|   

Error: COMPILER_WARNING: [#def58]
zstd-1.5.7/tests/zstreamtest.c: scope_hint: In function ‘basicUnitTests’
zstd-1.5.7/tests/zstreamtest.c:1899:32: warning[-Wunterminated-string-initialization]: initializer-string for array of ‘char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (7 chars into 6 available)
# 1899 |           char testBuffer[6] = "\xAA\xAA\xAA\xAA\xAA\xAA";
#      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~
# 1897|           /* Write a bunch of 6 byte blocks */
# 1898|           while (remainingInput > 0) {
# 1899|->           char testBuffer[6] = "\xAA\xAA\xAA\xAA\xAA\xAA";
# 1900|             const size_t kSmallBlockSize = sizeof(testBuffer);
# 1901|             ZSTD_inBuffer in = {testBuffer, kSmallBlockSize, 0};

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.19.1
diffbase-analyzer-version-gcc16.0.0
diffbase-analyzer-version-gcc-analyzer16.0.0
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-211.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namezstd-1.5.7-2.fc43
diffbase-store-results-to/tmp/tmpkr4geo9n/zstd-1.5.7-2.fc43.tar.xz
diffbase-time-created2026-01-08 22:17:34
diffbase-time-finished2026-01-08 22:22:24
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpkr4geo9n/zstd-1.5.7-2.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpkr4geo9n/zstd-1.5.7-2.fc43.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-211.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namezstd-1.5.7-3.fc44
store-results-to/tmp/tmpazzl8563/zstd-1.5.7-3.fc44.tar.xz
time-created2026-01-08 22:22:43
time-finished2026-01-08 22:27:22
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpazzl8563/zstd-1.5.7-3.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpazzl8563/zstd-1.5.7-3.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9