Fixed findings

List of Findings

Error: COMPILER_WARNING (CWE-704): [#def1]
libsolv-0.7.36/ext/solv_xfopen.c: scope_hint: In function ‘solv_xfopen’
libsolv-0.7.36/ext/solv_xfopen.c:670:7: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  670 |   suf = strrchr(fn, '.');
#      |       ^
#  668|     if (!mode)
#  669|       mode = "r";
#  670|->   suf = strrchr(fn, '.');
#  671|   #ifdef ENABLE_ZLIB_COMPRESSION
#  672|     if (suf && !strcmp(suf, ".gz"))

Error: COMPILER_WARNING (CWE-704): [#def2]
libsolv-0.7.36/ext/solv_xfopen.c:670:7: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  668|     if (!mode)
#  669|       mode = "r";
#  670|->   suf = strrchr(fn, '.');
#  671|   #ifdef ENABLE_ZLIB_COMPRESSION
#  672|     if (suf && !strcmp(suf, ".gz"))

Error: COMPILER_WARNING (CWE-704): [#def3]
libsolv-0.7.36/ext/solv_xfopen.c: scope_hint: In function ‘solv_xfopen_fd’
libsolv-0.7.36/ext/solv_xfopen.c:737:7: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  737 |   suf = fn ? strrchr(fn, '.') : 0;
#      |       ^
#  735|     char *suf;
#  736|   
#  737|->   suf = fn ? strrchr(fn, '.') : 0;
#  738|     if (!mode)
#  739|       {

Error: COMPILER_WARNING (CWE-704): [#def4]
libsolv-0.7.36/ext/solv_xfopen.c:737:7: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  735|     char *suf;
#  736|   
#  737|->   suf = fn ? strrchr(fn, '.') : 0;
#  738|     if (!mode)
#  739|       {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def5]
libsolv-0.7.36/src/chksum.c:280:10: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libsolv-0.7.36/src/chksum.c:270:1: enter_function: entry to ‘solv_chksum_cmp’
libsolv-0.7.36/src/chksum.c:274:6: branch_false: following ‘false’ branch (when ‘chk != chk2’)...
libsolv-0.7.36/src/chksum.c:276:7: branch_false: ...to here
libsolv-0.7.36/src/chksum.c:276:6: branch_false: following ‘false’ branch...
libsolv-0.7.36/src/chksum.c:278:10: call_function: calling ‘solv_chksum_get’ from ‘solv_chksum_cmp’
libsolv-0.7.36/src/chksum.c:278:10: return_function: returning to ‘solv_chksum_cmp’ from ‘solv_chksum_get’
libsolv-0.7.36/src/chksum.c:279:10: call_function: calling ‘solv_chksum_get’ from ‘solv_chksum_cmp’
libsolv-0.7.36/src/chksum.c:279:10: return_function: returning to ‘solv_chksum_cmp’ from ‘solv_chksum_get’
libsolv-0.7.36/src/chksum.c:280:10: danger: argument 2 (‘solv_chksum_get(chk2, 0)’) NULL where non-null expected
#  278|     res1 = solv_chksum_get(chk, &len);
#  279|     res2 = solv_chksum_get(chk2, 0);
#  280|->   return memcmp(res1, res2, len) == 0 ? 1 : 0;
#  281|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def6]
libsolv-0.7.36/src/dirpool.c:93:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libsolv-0.7.36/src/dirpool.c:81:1: enter_function: entry to ‘dirpool_make_dirtraverse’
libsolv-0.7.36/src/dirpool.c:84:6: branch_false: following ‘false’ branch...
libsolv-0.7.36/src/dirpool.c:86:14: branch_false: ...to here
libsolv-0.7.36/src/dirpool.c:87:17: call_function: calling ‘solv_calloc_block’ from ‘dirpool_make_dirtraverse’
libsolv-0.7.36/src/dirpool.c:87:17: return_function: returning to ‘dirpool_make_dirtraverse’ from ‘solv_calloc_block’
libsolv-0.7.36/src/dirpool.c:88:15: branch_true: following ‘true’ branch...
libsolv-0.7.36/src/dirpool.c:90:11: branch_true: ...to here
libsolv-0.7.36/src/dirpool.c:90:10: branch_false: following ‘false’ branch...
libsolv-0.7.36/src/dirpool.c:92:7: branch_false: ...to here
libsolv-0.7.36/src/dirpool.c:93:7: danger: dereference of NULL ‘solv_calloc_block((long unsigned int)*dp.ndirs, 4, 127) + (long unsigned int)i * 4’
#   91|   	continue;
#   92|         parent = -dp->dirs[i];
#   93|->       dirtraverse[i] = dirtraverse[parent];
#   94|         dirtraverse[parent] = i + 1;
#   95|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def7]
libsolv-0.7.36/src/pool.c:566:9: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
libsolv-0.7.36/src/pool.c:549:1: enter_function: entry to ‘pool_tmpappend’
libsolv-0.7.36/src/pool.c:554:3: branch_true: following ‘true’ branch (when ‘str1’ is non-NULL)...
libsolv-0.7.36/src/pool.c:554:15: branch_true: ...to here
libsolv-0.7.36/src/pool.c:555:3: branch_false: following ‘false’ branch (when ‘str2’ is NULL)...
libsolv-0.7.36/src/pool.c:556:3: branch_false: ...to here
libsolv-0.7.36/src/pool.c:556:3: branch_false: following ‘false’ branch (when ‘str3’ is NULL)...
libsolv-0.7.36/src/pool.c:557:45: branch_false: ...to here
libsolv-0.7.36/src/pool.c:557:9: call_function: calling ‘pool_alloctmpspace_free’ from ‘pool_tmpappend’
libsolv-0.7.36/src/pool.c:557:9: return_function: returning to ‘pool_tmpappend’ from ‘pool_alloctmpspace_free’
libsolv-0.7.36/src/pool.c:558:6: branch_false: following ‘false’ branch...
libsolv-0.7.36/src/pool.c:561:11: branch_false: ...to here
libsolv-0.7.36/src/pool.c:561:11: call_function: calling ‘pool_alloctmpspace’ from ‘pool_tmpappend’
libsolv-0.7.36/src/pool.c:561:11: return_function: returning to ‘pool_tmpappend’ from ‘pool_alloctmpspace’
libsolv-0.7.36/src/pool.c:563:6: branch_true: following ‘true’ branch (when ‘l1 != 0’)...
libsolv-0.7.36/src/pool.c:565:10: branch_true: ...to here
libsolv-0.7.36/src/pool.c:565:10: branch_true: following ‘true’ branch (when ‘str1 != str’)...
libsolv-0.7.36/src/pool.c:566:9: branch_true: ...to here
libsolv-0.7.36/src/pool.c:566:9: danger: argument 1 (‘str’) NULL where non-null expected
#  564|       {
#  565|         if (s != str1)
#  566|->         strcpy(s, str1);
#  567|         s += l1;
#  568|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def8]
libsolv-0.7.36/src/pool.c:571:7: warning[-Wanalyzer-null-argument]: use of NULL ‘s’ where non-null expected
libsolv-0.7.36/src/pool.c:549:1: enter_function: entry to ‘pool_tmpappend’
libsolv-0.7.36/src/pool.c:555:3: branch_true: following ‘true’ branch (when ‘str2’ is non-NULL)...
libsolv-0.7.36/src/pool.c:555:15: branch_true: ...to here
libsolv-0.7.36/src/pool.c:556:3: branch_false: following ‘false’ branch (when ‘str3’ is NULL)...
libsolv-0.7.36/src/pool.c:557:45: branch_false: ...to here
libsolv-0.7.36/src/pool.c:557:9: call_function: calling ‘pool_alloctmpspace_free’ from ‘pool_tmpappend’
libsolv-0.7.36/src/pool.c:557:9: return_function: returning to ‘pool_tmpappend’ from ‘pool_alloctmpspace_free’
libsolv-0.7.36/src/pool.c:558:6: branch_false: following ‘false’ branch...
libsolv-0.7.36/src/pool.c:561:11: branch_false: ...to here
libsolv-0.7.36/src/pool.c:561:11: call_function: calling ‘pool_alloctmpspace’ from ‘pool_tmpappend’
libsolv-0.7.36/src/pool.c:561:11: return_function: returning to ‘pool_tmpappend’ from ‘pool_alloctmpspace’
libsolv-0.7.36/src/pool.c:563:6: branch_false: following ‘false’ branch (when ‘l1 == 0’)...
libsolv-0.7.36/src/pool.c:569:6: branch_false: ...to here
libsolv-0.7.36/src/pool.c:569:6: branch_true: following ‘true’ branch (when ‘l2 != 0’)...
libsolv-0.7.36/src/pool.c:571:7: branch_true: ...to here
libsolv-0.7.36/src/pool.c:571:7: danger: argument 1 (‘s’) NULL where non-null expected
#  569|     if (l2)
#  570|       {
#  571|->       strcpy(s, str2);
#  572|         s += l2;
#  573|       }

Error: COMPILER_WARNING (CWE-704): [#def9]
libsolv-0.7.36/src/selection.c: scope_hint: In function ‘selection_name_arch_rel’
libsolv-0.7.36/src/selection.c:907:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  907 |       if ((r = strpbrk(name, "<=>")) != 0)
#      |              ^
#  905|     if ((flags & SELECTION_REL) != 0)
#  906|       {
#  907|->       if ((r = strpbrk(name, "<=>")) != 0)
#  908|   	{
#  909|   	  rname = solv_strdup(name);

Error: COMPILER_WARNING (CWE-704): [#def10]
libsolv-0.7.36/src/selection.c:907:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  905|     if ((flags & SELECTION_REL) != 0)
#  906|       {
#  907|->       if ((r = strpbrk(name, "<=>")) != 0)
#  908|   	{
#  909|   	  rname = solv_strdup(name);

Error: COMPILER_WARNING (CWE-704): [#def11]
libsolv-0.7.36/src/selection.c: scope_hint: In function ‘selection_canon’
libsolv-0.7.36/src/selection.c:1175:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1175 |       if ((r = strchr(name, '_')) == 0)
#      |              ^
# 1173|     if (pool->disttype == DISTTYPE_DEB)
# 1174|       {
# 1175|->       if ((r = strchr(name, '_')) == 0)
# 1176|   	return 0;
# 1177|         rname = solv_strdup(name);	/* so we can modify it */

Error: COMPILER_WARNING (CWE-704): [#def12]
libsolv-0.7.36/src/selection.c:1175:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1173|     if (pool->disttype == DISTTYPE_DEB)
# 1174|       {
# 1175|->       if ((r = strchr(name, '_')) == 0)
# 1176|   	return 0;
# 1177|         rname = solv_strdup(name);	/* so we can modify it */

Error: COMPILER_WARNING (CWE-704): [#def13]
libsolv-0.7.36/src/selection.c:1198:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1198 |       if ((r = strchr(name, '-')) == 0)
#      |              ^
# 1196|     if (pool->disttype == DISTTYPE_HAIKU)
# 1197|       {
# 1198|->       if ((r = strchr(name, '-')) == 0)
# 1199|   	return 0;
# 1200|         rname = solv_strdup(name);	/* so we can modify it */

Error: COMPILER_WARNING (CWE-704): [#def14]
libsolv-0.7.36/src/selection.c:1198:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1196|     if (pool->disttype == DISTTYPE_HAIKU)
# 1197|       {
# 1198|->       if ((r = strchr(name, '-')) == 0)
# 1199|   	return 0;
# 1200|         rname = solv_strdup(name);	/* so we can modify it */

Error: COMPILER_WARNING (CWE-704): [#def15]
libsolv-0.7.36/src/selection.c:1219:10: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1219 |   if ((r = strrchr(name, '-')) == 0)
#      |          ^
# 1217|       }
# 1218|   
# 1219|->   if ((r = strrchr(name, '-')) == 0)
# 1220|       return 0;
# 1221|     rname = solv_strdup(name);	/* so we can modify it */

Error: COMPILER_WARNING (CWE-704): [#def16]
libsolv-0.7.36/src/selection.c:1219:10: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1217|       }
# 1218|   
# 1219|->   if ((r = strrchr(name, '-')) == 0)
# 1220|       return 0;
# 1221|     rname = solv_strdup(name);	/* so we can modify it */

Error: COMPILER_WARNING (CWE-704): [#def17]
libsolv-0.7.36/src/suse.c: scope_hint: In function ‘repo_fix_supplements’
libsolv-0.7.36/src/suse.c:166:23: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  166 |           else if ((p = strchr(dep, ':')) != 0 && p != dep && p[1] == '/' && strlen(dep) < sizeof(buf))
#      |                       ^
#  164|   		supplements = repo_addid_dep(repo, supplements, id, 0);
#  165|   	    }
#  166|-> 	  else if ((p = strchr(dep, ':')) != 0 && p != dep && p[1] == '/' && strlen(dep) < sizeof(buf))
#  167|   	    {
#  168|   	      strcpy(buf, dep);

Error: COMPILER_WARNING (CWE-704): [#def18]
libsolv-0.7.36/src/suse.c:166:23: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  164|   		supplements = repo_addid_dep(repo, supplements, id, 0);
#  165|   	    }
#  166|-> 	  else if ((p = strchr(dep, ':')) != 0 && p != dep && p[1] == '/' && strlen(dep) < sizeof(buf))
#  167|   	    {
#  168|   	      strcpy(buf, dep);

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.97.1
diffbase-analyzer-version-cppcheck2.21.1
diffbase-analyzer-version-gcc16.1.1
diffbase-analyzer-version-gcc-analyzer16.1.1
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-198.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.20260524.213755.g3c6d0be.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namelibsolv-0.7.39-7.fc45
diffbase-store-results-to/tmp/tmpx4zf4gsp/libsolv-0.7.39-7.fc45.tar.xz
diffbase-time-created2026-08-03 17:54:43
diffbase-time-finished2026-08-03 17:57:09
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpx4zf4gsp/libsolv-0.7.39-7.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpx4zf4gsp/libsolv-0.7.39-7.fc45.src.rpm'
diffbase-tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-198.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibsolv-0.7.36-2.fc44
store-results-to/tmp/tmpnpxjqq3q/libsolv-0.7.36-2.fc44.tar.xz
time-created2026-08-03 17:51:19
time-finished2026-08-03 17:54:32
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpnpxjqq3q/libsolv-0.7.36-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpnpxjqq3q/libsolv-0.7.36-2.fc44.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9