Fixed findings

List of Findings

Error: COMPILER_WARNING (CWE-704): [#def1]
p11-kit-0.26.2/common/base64.c: scope_hint: In function ‘p11_b64_pton’
p11-kit-0.26.2/common/base64.c:90:21: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   90 |                 pos = strchr (Base64, ch);
#      |                     ^
#   88|   			break;
#   89|   
#   90|-> 		pos = strchr (Base64, ch);
#   91|   		if (pos == 0) /* A non-base64 character. */
#   92|   			return (-1);

Error: COMPILER_WARNING (CWE-704): [#def2]
p11-kit-0.26.2/common/base64.c:90:21: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   88|   			break;
#   89|   
#   90|-> 		pos = strchr (Base64, ch);
#   91|   		if (pos == 0) /* A non-base64 character. */
#   92|   			return (-1);

Error: COMPILER_WARNING (CWE-704): [#def3]
p11-kit-0.26.2/common/url.c: scope_hint: In function ‘p11_url_decode’
p11-kit-0.26.2/common/url.c:79:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   79 |                         a = strchr (HEX_CHARS_UPPER, p11_ascii_toupper (value[0]));
#      |                           ^
#   77|   				return NULL;
#   78|   			}
#   79|-> 			a = strchr (HEX_CHARS_UPPER, p11_ascii_toupper (value[0]));
#   80|   			b = strchr (HEX_CHARS_UPPER, p11_ascii_toupper (value[1]));
#   81|   			if (!a || !b) {

Error: COMPILER_WARNING (CWE-704): [#def4]
p11-kit-0.26.2/common/url.c:79:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   77|   				return NULL;
#   78|   			}
#   79|-> 			a = strchr (HEX_CHARS_UPPER, p11_ascii_toupper (value[0]));
#   80|   			b = strchr (HEX_CHARS_UPPER, p11_ascii_toupper (value[1]));
#   81|   			if (!a || !b) {

Error: COMPILER_WARNING (CWE-704): [#def5]
p11-kit-0.26.2/common/url.c:80:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   80 |                         b = strchr (HEX_CHARS_UPPER, p11_ascii_toupper (value[1]));
#      |                           ^
#   78|   			}
#   79|   			a = strchr (HEX_CHARS_UPPER, p11_ascii_toupper (value[0]));
#   80|-> 			b = strchr (HEX_CHARS_UPPER, p11_ascii_toupper (value[1]));
#   81|   			if (!a || !b) {
#   82|   				free (result);

Error: COMPILER_WARNING (CWE-704): [#def6]
p11-kit-0.26.2/common/url.c:80:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   78|   			}
#   79|   			a = strchr (HEX_CHARS_UPPER, p11_ascii_toupper (value[0]));
#   80|-> 			b = strchr (HEX_CHARS_UPPER, p11_ascii_toupper (value[1]));
#   81|   			if (!a || !b) {
#   82|   				free (result);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
p11-kit-0.26.2/p11-kit/uri.c:848:25: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(name)’
p11-kit-0.26.2/p11-kit/uri.c:876:1: enter_function: entry to ‘p11_kit_uri_set_vendor_query’
p11-kit-0.26.2/p11-kit/uri.c:882:9: branch_true: following ‘true’ branch (when ‘uri’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:890:12: branch_true: following ‘true’ branch...
p11-kit-0.26.2/p11-kit/uri.c:891:20: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:891:20: branch_false: following ‘false’ branch (when ‘value’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:893:24: branch_false: ...to here
p11-kit-0.26.2/p11-kit/uri.c:893:24: acquire_memory: allocated here
p11-kit-0.26.2/p11-kit/uri.c:893:24: call_function: calling ‘insert_attribute’ from ‘p11_kit_uri_set_vendor_query’
#  846|   	return_val_if_fail (value != NULL, false);
#  847|   
#  848|-> 	for (i = 0; i < attrs->num; i++) {
#  849|   		attr = attrs->elem[i];
#  850|   		if (strcmp (attr->name, (char *)name) > 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
p11-kit-0.26.2/p11-kit/uri.c:848:25: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(value)’
p11-kit-0.26.2/p11-kit/uri.c:876:1: enter_function: entry to ‘p11_kit_uri_set_vendor_query’
p11-kit-0.26.2/p11-kit/uri.c:882:9: branch_true: following ‘true’ branch (when ‘uri’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:890:12: branch_true: following ‘true’ branch...
p11-kit-0.26.2/p11-kit/uri.c:891:20: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:891:20: branch_false: following ‘false’ branch (when ‘value’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:893:24: branch_false: ...to here
p11-kit-0.26.2/p11-kit/uri.c:893:24: acquire_memory: allocated here
p11-kit-0.26.2/p11-kit/uri.c:893:24: call_function: calling ‘insert_attribute’ from ‘p11_kit_uri_set_vendor_query’
#  846|   	return_val_if_fail (value != NULL, false);
#  847|   
#  848|-> 	for (i = 0; i < attrs->num; i++) {
#  849|   		attr = attrs->elem[i];
#  850|   		if (strcmp (attr->name, (char *)name) > 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
p11-kit-0.26.2/p11-kit/uri.c:861:1: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(name)’
p11-kit-0.26.2/p11-kit/uri.c:876:1: enter_function: entry to ‘p11_kit_uri_set_vendor_query’
p11-kit-0.26.2/p11-kit/uri.c:882:9: branch_true: following ‘true’ branch (when ‘uri’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:890:12: branch_true: following ‘true’ branch...
p11-kit-0.26.2/p11-kit/uri.c:891:20: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:891:20: branch_false: following ‘false’ branch (when ‘value’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:893:24: branch_false: ...to here
p11-kit-0.26.2/p11-kit/uri.c:893:24: acquire_memory: allocated here
p11-kit-0.26.2/p11-kit/uri.c:893:24: call_function: calling ‘insert_attribute’ from ‘p11_kit_uri_set_vendor_query’
#  859|   
#  860|   	return p11_array_insert (attrs, i, attr);
#  861|-> }
#  862|   
#  863|   /**

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
p11-kit-0.26.2/p11-kit/uri.c:861:1: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(value)’
p11-kit-0.26.2/p11-kit/uri.c:876:1: enter_function: entry to ‘p11_kit_uri_set_vendor_query’
p11-kit-0.26.2/p11-kit/uri.c:882:9: branch_true: following ‘true’ branch (when ‘uri’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:890:12: branch_true: following ‘true’ branch...
p11-kit-0.26.2/p11-kit/uri.c:891:20: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:891:20: branch_false: following ‘false’ branch (when ‘value’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:893:24: branch_false: ...to here
p11-kit-0.26.2/p11-kit/uri.c:893:24: acquire_memory: allocated here
p11-kit-0.26.2/p11-kit/uri.c:893:24: call_function: calling ‘insert_attribute’ from ‘p11_kit_uri_set_vendor_query’
#  859|   
#  860|   	return p11_array_insert (attrs, i, attr);
#  861|-> }
#  862|   
#  863|   /**

Error: GCC_ANALYZER_WARNING (CWE-457): [#def11]
p11-kit-0.26.2/p11-kit/uri.c:899:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘attr’
p11-kit-0.26.2/p11-kit/uri.c:882:9: branch_true: following ‘true’ branch (when ‘uri’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:883:9: branch_true: ...to here
p11-kit-0.26.2/p11-kit/uri.c:885:21: branch_false: following ‘false’ branch...
p11-kit-0.26.2/p11-kit/uri.c:890:12: branch_false: ...to here
p11-kit-0.26.2/p11-kit/uri.c:890:12: branch_false: following ‘false’ branch...
p11-kit-0.26.2/p11-kit/uri.c:896:12: branch_false: ...to here
p11-kit-0.26.2/p11-kit/uri.c:896:12: branch_false: following ‘false’ branch (when ‘value’ is non-NULL)...
p11-kit-0.26.2/p11-kit/uri.c:899:23: branch_false: ...to here
p11-kit-0.26.2/p11-kit/uri.c:899:23: danger: use of uninitialized value ‘attr’ here
#  897|   		p11_array_remove (uri->qattrs, i);
#  898|   	else {
#  899|-> 		free (attr->value);
#  900|   		attr->value = strdup (value);
#  901|   	}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def12]
p11-kit-0.26.2/trust/test-module.c:203:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(p11_path_build(p11_path_build(p11_test_directory("test-module"), "anchors", 0), "unreadable", 0), "w")’ where non-null expected
p11-kit-0.26.2/trust/test-module.c:190:9: branch_true: following ‘true’ branch...
p11-kit-0.26.2/trust/test-module.c:192:26: branch_true: ...to here
p11-kit-0.26.2/trust/test-module.c:202:13: acquire_memory: this call could return NULL
p11-kit-0.26.2/trust/test-module.c:203:9: danger: argument 4 (‘fopen(p11_path_build(p11_path_build(p11_test_directory("test-module"), "anchors", 0), "unreadable", 0), "w")’) from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) could be NULL where non-null expected
#  201|   	test.unreadable = p11_path_build (anchors, "unreadable", NULL);
#  202|   	f = fopen (test.unreadable, "w");
#  203|-> 	fwrite ("foo", 3, 1, f);
#  204|   	fclose (f);
#  205|   	chmod (test.unreadable, 0);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def13]
p11-kit-0.26.2/trust/test-module.c:210:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen("/builddir/build/BUILD/p11-kit-0.26.2/trust/fixtures/thawte.pem", "r")’ where non-null expected
p11-kit-0.26.2/trust/test-module.c:190:9: branch_true: following ‘true’ branch...
p11-kit-0.26.2/trust/test-module.c:192:26: branch_true: ...to here
p11-kit-0.26.2/trust/test-module.c:209:13: acquire_memory: this call could return NULL
p11-kit-0.26.2/trust/test-module.c:210:17: danger: argument 1 (‘fopen("/builddir/build/BUILD/p11-kit-0.26.2/trust/fixtures/thawte.pem", "r")’) from [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2) could be NULL where non-null expected
#  208|   	ff = fopen (p, "w");
#  209|   	f = fopen (SRCDIR "/trust/fixtures/thawte.pem", "r");
#  210|-> 	while (!feof (f)) {
#  211|   		size_t size;
#  212|   		size = fread (buffer, 1, sizeof (buffer), f);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def14]
p11-kit-0.26.2/trust/test-module.c:216:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(p11_path_build(p11_path_build(p11_test_directory("test-module"), "anchors", 0), "thawte", 0), "w")’ where non-null expected
p11-kit-0.26.2/trust/test-module.c:190:9: branch_true: following ‘true’ branch...
p11-kit-0.26.2/trust/test-module.c:192:26: branch_true: ...to here
p11-kit-0.26.2/trust/test-module.c:208:14: acquire_memory: this call could return NULL
p11-kit-0.26.2/trust/test-module.c:210:16: branch_true: following ‘true’ branch...
p11-kit-0.26.2/trust/test-module.c:212:24: branch_true: ...to here
p11-kit-0.26.2/trust/test-module.c:216:17: danger: argument 4 (‘fopen(p11_path_build(p11_path_build(p11_test_directory("test-module"), "anchors", 0), "thawte", 0), "w")’) from [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2) could be NULL where non-null expected
#  214|   			assert_fail ("fread()",
#  215|   				     SRCDIR "/trust/fixtures/thawte.pem");
#  216|-> 		fwrite (buffer, 1, size, ff);
#  217|   		if (ferror (ff))
#  218|   			assert_fail ("write()", p);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def15]
p11-kit-0.26.2/trust/test-module.c:221:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(p11_path_build(p11_path_build(p11_test_directory("test-module"), "anchors", 0), "thawte", 0), "w")’ where non-null expected
p11-kit-0.26.2/trust/test-module.c:190:9: branch_true: following ‘true’ branch...
p11-kit-0.26.2/trust/test-module.c:192:26: branch_true: ...to here
p11-kit-0.26.2/trust/test-module.c:208:14: acquire_memory: this call could return NULL
p11-kit-0.26.2/trust/test-module.c:210:16: branch_false: following ‘false’ branch...
p11-kit-0.26.2/trust/test-module.c:220:9: branch_false: ...to here
p11-kit-0.26.2/trust/test-module.c:221:9: danger: argument 1 (‘fopen(p11_path_build(p11_path_build(p11_test_directory("test-module"), "anchors", 0), "thawte", 0), "w")’) from [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2) could be NULL where non-null expected
#  219|   	}
#  220|   	free (p);
#  221|-> 	fclose (ff);
#  222|   	fclose (f);
#  223|   	free (anchors);

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-209.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-namep11-kit-0.26.4-2.fc45
diffbase-store-results-to/tmp/tmp4zbh5nxq/p11-kit-0.26.4-2.fc45.tar.xz
diffbase-time-created2026-08-03 19:00:33
diffbase-time-finished2026-08-03 19:06:18
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmp4zbh5nxq/p11-kit-0.26.4-2.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp4zbh5nxq/p11-kit-0.26.4-2.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-209.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-namep11-kit-0.26.2-1.fc44
store-results-to/tmp/tmpdu3dhf2_/p11-kit-0.26.2-1.fc44.tar.xz
time-created2026-08-03 18:53:41
time-finished2026-08-03 19:00:16
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpdu3dhf2_/p11-kit-0.26.2-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpdu3dhf2_/p11-kit-0.26.2-1.fc44.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9