libtiff-4.6.0-6.fc42

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-bi.c: scope_hint: In function ‘main’
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-bi.c:64:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘scan_line’
#   62|   
#   63|       for (i = 0; i < (WIDTH / 8) / 2; i++)
#   64|->         scan_line[i] = 0;
#   65|   
#   66|       for (i = (WIDTH / 8) / 2; i < (WIDTH / 8); i++)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-grayscale.c: scope_hint: In function ‘main’
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-grayscale.c:79:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘gray’
#   77|       gray = (uint16_t *)malloc(cmsize * sizeof(uint16_t));
#   78|   
#   79|->     gray[0] = 3000;
#   80|       for (i = 1; i < cmsize; i++)
#   81|           gray[i] = (uint16_t)(-log10((double)i / (cmsize - 1)) * 1000);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def3]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-grayscale.c:116:36: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘scan_line’
#  114|               {
#  115|                   case 8:
#  116|->                     scan_line[k++] = gray_index;
#  117|                       j++;
#  118|                       break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-grayscale.c:120:36: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘scan_line’
#  118|                       break;
#  119|                   case 4:
#  120|->                     scan_line[k++] = (gray_index << 4) + gray_index;
#  121|                       j += 2;
#  122|                       break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def5]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-grayscale.c:124:36: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘scan_line’
#  122|                       break;
#  123|                   case 2:
#  124|->                     scan_line[k++] = (gray_index << 6) + (gray_index << 4) +
#  125|                                        (gray_index << 2) + gray_index;
#  126|                       j += 4;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def6]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-palette.c: scope_hint: In function ‘main’
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-palette.c:96:28: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘red’
#   94|               {
#   95|                   if (i < 32)
#   96|->                     red[i] = 0;
#   97|                   else if (i < 64)
#   98|                       red[i] = SCALE(36);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def7]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-palette.c:113:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘green’
#  111|   
#  112|                   if ((i % 32) < 4)
#  113|->                     green[i] = 0;
#  114|                   else if (i < 8)
#  115|                       green[i] = SCALE(36);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def8]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-palette.c:130:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘blue’
#  128|   
#  129|                   if ((i % 4) == 0)
#  130|->                     blue[i] = SCALE(0);
#  131|                   else if ((i % 4) == 1)
#  132|                       blue[i] = SCALE(85);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def9]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-palette.c:140:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘red’
#  138|               break;
#  139|           case 4:
#  140|->             red[0] = SCALE(255);
#  141|               green[0] = 0;
#  142|               blue[0] = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def10]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-palette.c:141:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘green’
#  139|           case 4:
#  140|               red[0] = SCALE(255);
#  141|->             green[0] = 0;
#  142|               blue[0] = 0;
#  143|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def11]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-palette.c:142:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘blue’
#  140|               red[0] = SCALE(255);
#  141|               green[0] = 0;
#  142|->             blue[0] = 0;
#  143|   
#  144|               red[1] = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def12]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-palette.c:198:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘red’
#  196|               break;
#  197|           case 2:
#  198|->             red[0] = SCALE(255);
#  199|               green[0] = 0;
#  200|               blue[0] = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def13]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-palette.c:199:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘green’
#  197|           case 2:
#  198|               red[0] = SCALE(255);
#  199|->             green[0] = 0;
#  200|               blue[0] = 0;
#  201|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def14]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-palette.c:200:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘blue’
#  198|               red[0] = SCALE(255);
#  199|               green[0] = 0;
#  200|->             blue[0] = 0;
#  201|   
#  202|               red[1] = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def15]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-palette.c:214:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘red’
#  212|               break;
#  213|           case 1:
#  214|->             red[0] = 0;
#  215|               green[0] = 0;
#  216|               blue[0] = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def16]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-palette.c:215:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘green’
#  213|           case 1:
#  214|               red[0] = 0;
#  215|->             green[0] = 0;
#  216|               blue[0] = 0;
#  217|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def17]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-palette.c:216:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘blue’
#  214|               red[0] = 0;
#  215|               green[0] = 0;
#  216|->             blue[0] = 0;
#  217|   
#  218|               red[1] = SCALE(255);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def18]
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-rgb.c: scope_hint: In function ‘main’
libtiff-4.6.0-build/tiff-4.6.0/contrib/dbs/tiff-rgb.c:118:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘scan_line’
#  116|           for (j = 0; j < 75; j++)
#  117|           {
#  118|->             scan_line[j * 3] = 255;
#  119|               scan_line[(j * 3) + 1] = 255 - i;
#  120|               scan_line[(j * 3) + 2] = 255 - i;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def19]
libtiff-4.6.0-build/tiff-4.6.0/contrib/iptcutil/iptcutil.c: scope_hint: In function ‘super_fgets’
libtiff-4.6.0-build/tiff-4.6.0/contrib/iptcutil/iptcutil.c:336:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘q’
#  334|               q = b + tlen;
#  335|           }
#  336|->         *q = (unsigned char)c;
#  337|       }
#  338|       *blen = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
libtiff-4.6.0-build/tiff-4.6.0/contrib/iptcutil/iptcutil.c:344:12: warning[-Wanalyzer-malloc-leak]: leak of ‘b’
#  342|   
#  343|           tlen = (int)(q - b);
#  344|->         if (tlen == 0)
#  345|               return (char *)NULL;
#  346|           b[tlen] = '\0';

Error: GCC_ANALYZER_WARNING (CWE-476): [#def21]
libtiff-4.6.0-build/tiff-4.6.0/contrib/iptcutil/iptcutil.c: scope_hint: In function ‘chstore’
libtiff-4.6.0-build/tiff-4.6.0/contrib/iptcutil/iptcutil.c:764:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘string’
libtiff-4.6.0-build/tiff-4.6.0/contrib/iptcutil/iptcutil.c: scope_hint: In function ‘chstore’
libtiff-4.6.0-build/tiff-4.6.0/contrib/iptcutil/iptcutil.c: scope_hint: In function ‘chstore’
libtiff-4.6.0-build/tiff-4.6.0/contrib/iptcutil/iptcutil.c: scope_hint: In function ‘chstore’
#  762|                       break;
#  763|               }
#  764|->         string[_p_tokpos++] = c;
#  765|       }
#  766|       return;

Error: COMPILER_WARNING: [#def22]
libtiff-4.6.0-build/tiff-4.6.0/libtiff/tif_hash_set.c: scope_hint: In function 'TIFFHashSetNew'
libtiff-4.6.0-build/tiff-4.6.0/libtiff/tif_hash_set.c:149:48: warning[-Wcalloc-transposed-args]: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument
#  149 |     set->tabList = (TIFFList **)(calloc(sizeof(TIFFList *), 53));
#      |                                                ^~~~~~~~
libtiff-4.6.0-build/tiff-4.6.0/libtiff/tif_hash_set.c:149:48: note: earlier argument should specify number of elements, later size of each element
#  147|       set->fnFreeEltFunc = fnFreeEltFunc;
#  148|       set->nSize = 0;
#  149|->     set->tabList = (TIFFList **)(calloc(sizeof(TIFFList *), 53));
#  150|       if (set->tabList == NULL)
#  151|       {

Error: COMPILER_WARNING: [#def23]
libtiff-4.6.0-build/tiff-4.6.0/libtiff/tif_hash_set.c: scope_hint: In function 'TIFFHashSetRehash'
libtiff-4.6.0-build/tiff-4.6.0/libtiff/tif_hash_set.c:370:37: warning[-Wcalloc-transposed-args]: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument
#  370 |         (TIFFList **)(calloc(sizeof(TIFFList *), nNewAllocatedSize));
#      |                                     ^~~~~~~~
libtiff-4.6.0-build/tiff-4.6.0/libtiff/tif_hash_set.c:370:37: note: earlier argument should specify number of elements, later size of each element
#  368|       int nNewAllocatedSize = anPrimes[set->nIndiceAllocatedSize];
#  369|       TIFFList **newTabList =
#  370|->         (TIFFList **)(calloc(sizeof(TIFFList *), nNewAllocatedSize));
#  371|       if (newTabList == NULL)
#  372|           return false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
libtiff-4.6.0-build/tiff-4.6.0/libtiff/tif_hash_set.c: scope_hint: In function 'TIFFHashSetInsert'
libtiff-4.6.0-build/tiff-4.6.0/libtiff/tif_hash_set.c:483:8: warning[-Wanalyzer-malloc-leak]: leak of 'TIFFHashSetGetNewListElt(set)'
libtiff-4.6.0-build/tiff-4.6.0/libtiff/tif_hash_set.c:33: included_from: Included from here.
#  481|       new_elt->psNext = set->tabList[nHashVal];
#  482|       set->tabList[nHashVal] = new_elt;
#  483|->     set->nSize++;
#  484|   
#  485|       return true;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def25]
libtiff-4.6.0-build/tiff-4.6.0/libtiff/tif_packbits.c: scope_hint: In function 'PackBitsEncode'
libtiff-4.6.0-build/tiff-4.6.0/libtiff/tif_packbits.c:109:29: warning[-Wanalyzer-null-dereference]: dereference of NULL 'lastliteral'
#  107|                   op = tif->tif_rawcp;
#  108|                   while (slop-- > 0)
#  109|->                     *op++ = *lastliteral++;
#  110|                   lastliteral = tif->tif_rawcp;
#  111|               }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def26]
libtiff-4.6.0-build/tiff-4.6.0/libtiff/tif_packbits.c:160:28: warning[-Wanalyzer-null-dereference]: dereference of NULL 'lastliteral'
#  158|                   else
#  159|                   { /* extend literal */
#  160|->                     if (++(*lastliteral) == 127)
#  161|                           state = BASE;
#  162|                       *op++ = (uint8_t)b;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def27]
libtiff-4.6.0-build/tiff-4.6.0/libtiff/tif_packbits.c:193:56: warning[-Wanalyzer-null-dereference]: dereference of NULL 'lastliteral'
#  191|                    * to a single literal.
#  192|                    */
#  193|->                 if (n == 1 && op[-2] == (uint8_t)-1 && *lastliteral < 126)
#  194|                   {
#  195|                       state = (((*lastliteral) += 2) == 127 ? BASE : LITERAL);

Error: CPPCHECK_WARNING (CWE-401): [#def28]
libtiff-4.6.0-build/tiff-4.6.0/tools/tiffdump.c:259: error[memleakOnRealloc]: Common realloc mistake: 'visited_diroff' nulled but not freed upon failure
#  257|               else
#  258|               {
#  259|->                 visited_diroff =
#  260|                       (uint64_t *)realloc(visited_diroff, alloc_size);
#  261|               }

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-177.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namelibtiff-4.6.0-6.fc42
store-results-to/tmp/tmpd8xwmkdo/libtiff-4.6.0-6.fc42.tar.xz
time-created2024-11-13 01:48:15
time-finished2024-11-13 01:50:24
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpd8xwmkdo/libtiff-4.6.0-6.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpd8xwmkdo/libtiff-4.6.0-6.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9