Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
xdg-desktop-portal-1.21.1/document-portal/gvdb/gvdb-builder.c:332:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xdg-desktop-portal-1.21.1/document-portal/gvdb/gvdb-builder.c:524:1: enter_function: entry to ‘gvdb_table_write_contents’
xdg-desktop-portal-1.21.1/document-portal/gvdb/gvdb-builder.c:532:13: call_function: calling ‘gvdb_table_get_content’ from ‘gvdb_table_write_contents’
#  330|   
#  331|   #define chunk(s) (size -= (s), data += (s), data - (s))
#  332|->   memcpy (chunk (sizeof bloom_hdr), &bloom_hdr, sizeof bloom_hdr);
#  333|     memcpy (chunk (sizeof table_hdr), &table_hdr, sizeof table_hdr);
#  334|     *bloom_filter = (guint32_le *) chunk (n_bloom_words * sizeof (guint32_le));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
xdg-desktop-portal-1.21.1/document-portal/permission-db.c:545:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ids’
xdg-desktop-portal-1.21.1/document-portal/permission-db.c:533:1: enter_function: entry to ‘permission_db_list_ids_by_value’
xdg-desktop-portal-1.21.1/document-portal/permission-db.c:536:27: call_function: calling ‘permission_db_list_ids’ from ‘permission_db_list_ids_by_value’
xdg-desktop-portal-1.21.1/document-portal/permission-db.c:536:27: return_function: returning to ‘permission_db_list_ids_by_value’ from ‘permission_db_list_ids’
xdg-desktop-portal-1.21.1/document-portal/permission-db.c:536:21: release_memory: ‘ids’ is NULL
xdg-desktop-portal-1.21.1/document-portal/permission-db.c:540:3: branch_false: following ‘false’ branch (when ‘self’ is non-NULL)...
xdg-desktop-portal-1.21.1/document-portal/permission-db.c:540:3: branch_false: ...to here
xdg-desktop-portal-1.21.1/document-portal/permission-db.c:541:3: branch_true: following ‘true’ branch (when ‘data’ is non-NULL)...
xdg-desktop-portal-1.21.1/document-portal/permission-db.c:543:9: branch_true: ...to here
xdg-desktop-portal-1.21.1/document-portal/permission-db.c:545:15: danger: dereference of NULL ‘permission_db_list_ids(self) + (long unsigned int)i * 8’
#  543|     res = g_ptr_array_new ();
#  544|   
#  545|->   for (i = 0; ids[i] != NULL; i++)
#  546|       {
#  547|         char *id = ids[i];

Error: COMPILER_WARNING (CWE-704): [#def3]
xdg-desktop-portal-1.21.1/src/xdp-documents.c: scope_hint: In function ‘xdp_looks_like_document_portal_path’
xdg-desktop-portal-1.21.1/src/xdp-documents.c:290:5: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  290 |   p = strstr (path, "/doc/");
#      |     ^
#  288|       return FALSE;
#  289|   
#  290|->   p = strstr (path, "/doc/");
#  291|     if (!p)
#  292|       return FALSE;

Error: COMPILER_WARNING (CWE-704): [#def4]
xdg-desktop-portal-1.21.1/src/xdp-documents.c:290:5: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  288|       return FALSE;
#  289|   
#  290|->   p = strstr (path, "/doc/");
#  291|     if (!p)
#  292|       return FALSE;

Scan Properties

analyzer-version-clippy1.95.0
analyzer-version-cppcheck2.20.0
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.95.0
diffbase-analyzer-version-cppcheck2.20.0
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-14.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-namexdg-desktop-portal-1.21.2-1.fc45
diffbase-store-results-to/tmp/tmp1m5klv8c/xdg-desktop-portal-1.21.2-1.fc45.tar.xz
diffbase-time-created2026-06-01 17:26:40
diffbase-time-finished2026-06-01 17:29:28
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,cppcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmp1m5klv8c/xdg-desktop-portal-1.21.2-1.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp1m5klv8c/xdg-desktop-portal-1.21.2-1.fc45.src.rpm'
diffbase-tool-versioncsmock-3.8.5.20260529.133039.g6f3b5c6-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-14.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-namexdg-desktop-portal-1.21.1-1.fc44
store-results-to/tmp/tmpsrrjno3_/xdg-desktop-portal-1.21.1-1.fc44.tar.xz
time-created2026-06-01 17:22:54
time-finished2026-06-01 17:26:14
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,cppcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmpsrrjno3_/xdg-desktop-portal-1.21.1-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpsrrjno3_/xdg-desktop-portal-1.21.1-1.fc44.src.rpm'
tool-versioncsmock-3.8.5.20260529.133039.g6f3b5c6-1.el9