xdg-desktop-portal-1.18.4-1.fc41

List of Defects

Error: CPPCHECK_WARNING: [#def1]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal-fuse.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def2]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal-fuse.c:1624:21: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
# 1622|   abort_reply_entry (struct fuse_entry_param *e)
# 1623|   {
# 1624|->   XdpInode *inode = xdp_inode_from_ino (e->ino);
# 1625|     xdp_inode_kernel_unref (inode, 1);
# 1626|   }

Error: CLANG_WARNING: [#def3]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal-fuse.c:2419:23: warning[unix.Malloc]: Potential leak of memory pointed to by 'p'
# 2417|                     if (errno && rem == size)
# 2418|                       {
# 2419|->                       xdp_reply_err (op, req, errno);
# 2420|                         return;
# 2421|                       }

Error: CLANG_WARNING: [#def4]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal-fuse.c:3108:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'buf'
# 3106|   
# 3107|     if (res < 0)
# 3108|->     return xdp_reply_err (op, req, errno);
# 3109|   
# 3110|     if (size == 0)

Error: CPPCHECK_WARNING: [#def5]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c: scope_hint: In function ‘validate_fd’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c:411:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dirname, 2621440)’
#  409|       goto errout;
#  410|   
#  411|->   dir_fd = open (dirname, O_CLOEXEC | O_PATH);
#  412|     if (dir_fd < 0 || fstat (dir_fd, real_dir_st_buf) != 0)
#  413|       goto errout;

Error: CLANG_WARNING: [#def7]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c:736:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'documents_flags'
#  734|     if (fd_list == NULL)
#  735|       {
#  736|->       g_dbus_method_invocation_return_error (invocation,
#  737|                                                XDG_DESKTOP_PORTAL_ERROR, XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENT,
#  738|                                                "No fds passed");

Error: CLANG_WARNING: [#def8]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c:736:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'fd'
#  734|     if (fd_list == NULL)
#  735|       {
#  736|->       g_dbus_method_invocation_return_error (invocation,
#  737|                                                XDG_DESKTOP_PORTAL_ERROR, XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENT,
#  738|                                                "No fds passed");

Error: GCC_ANALYZER_WARNING (CWE-688): [#def9]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c: scope_hint: In function ‘document_add_full’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c:863:19: warning[-Wanalyzer-null-argument]: use of NULL ‘dirname’ where non-null expected
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-store.h:6: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c:39: included_from: Included from here.
/usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here.
/usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
/usr/include/glib-2.0/gio/gioenums.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/giotypes.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/gio.h:28: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c:35: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/xdp-utils.h:168:3: note: in expansion of macro ‘g_assert’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/xdp-utils.h: scope_hint: In function ‘document_add_full’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c:33: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c:451:3: note: in expansion of macro ‘g_assert’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c:461:3: note: in expansion of macro ‘XDP_AUTOLOCK’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c: scope_hint: In function ‘document_add_full’
/usr/include/glib-2.0/glib/gmacros.h:1358:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:100:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:100:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:100:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c: scope_hint: In function ‘document_add_full’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c:860:27: note: in expansion of macro ‘g_strdup’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c: scope_hint: In function ‘document_add_full’
/usr/include/features.h:511: included_from: Included from here.
/usr/include/locale.h:25: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c:25: included_from: Included from here.
/usr/include/sys/stat.h:327:12: note: argument 1 of ‘lstat’ must be non-null
#  861|                 else
#  862|                   dirname = g_path_get_dirname (path);
#  863|->               if (lstat (dirname, &real_dir_st_bufs[i]) != 0)
#  864|                   {
#  865|                     g_set_error (error,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def10]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c: scope_hint: In function ‘portal_lookup’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-portal.c:1244:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(filename, 2621440)’
# 1242|     g_variant_get (parameters, "(^&ay)", &filename);
# 1243|   
# 1244|->   fd = open (filename, O_PATH | O_CLOEXEC);
# 1245|     if (fd == -1)
# 1246|       {

Error: CPPCHECK_WARNING: [#def11]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/document-store.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def12]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/file-transfer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def13]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/file-transfer.c: scope_hint: In function ‘file_transfer_execute’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/file-transfer.c:295:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*file.path, 2621440)’
/usr/include/glib-2.0/glib.h:33: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here.
/usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
/usr/include/glib-2.0/gio/gioenums.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/giotypes.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/gio.h:28: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/file-transfer.c:36: included_from: Included from here.
/usr/include/glib-2.0/glib/garray.h:149:46: note: in definition of macro ‘g_ptr_array_index’
#  293|         ExportedFile *file = (ExportedFile*)g_ptr_array_index (transfer->files, i);
#  294|   
#  295|->       fds[i] = open (file->path, O_PATH | O_CLOEXEC);
#  296|         if (fds[i] == -1)
#  297|           {

Error: CLANG_WARNING: [#def14]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/file-transfer.c:298:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'documents_flags'
#  296|         if (fds[i] == -1)
#  297|           {
#  298|->           g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), "File transfer %s failed", transfer->key);
#  299|             for (; i > 0; i--)
#  300|               close (fds[i - 1]);

Error: CLANG_WARNING: [#def15]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/file-transfer.c:298:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'parent_devs'
#  296|         if (fds[i] == -1)
#  297|           {
#  298|->           g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), "File transfer %s failed", transfer->key);
#  299|             for (; i > 0; i--)
#  300|               close (fds[i - 1]);

Error: CLANG_WARNING: [#def16]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/file-transfer.c:298:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'parent_inos'
#  296|         if (fds[i] == -1)
#  297|           {
#  298|->           g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), "File transfer %s failed", transfer->key);
#  299|             for (; i > 0; i--)
#  300|               close (fds[i - 1]);

Error: CLANG_WARNING: [#def17]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/file-transfer.c:301:18: warning[unix.Malloc]: Potential leak of memory pointed to by 'fds'
#  299|             for (; i > 0; i--)
#  300|               close (fds[i - 1]);
#  301|->           return NULL;
#  302|           }
#  303|   

Error: CPPCHECK_WARNING: [#def18]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/gvdb/gvdb-builder.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def19]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/gvdb/gvdb-builder.c: scope_hint: In function ‘file_builder_allocate_for_hash’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/gvdb/gvdb-builder.c:332:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
/usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here.
/usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
/usr/include/glib-2.0/gio/gioenums.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/giotypes.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/gio.h:28: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/gvdb/gvdb-builder.h:23: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/gvdb/gvdb-builder.c:20: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/gvdb/gvdb-builder.c:319:3: note: in expansion of macro ‘g_assert’
#  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: CLANG_WARNING: [#def20]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/gvdb/gvdb-builder.c:332:3: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  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: CPPCHECK_WARNING: [#def21]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/gvdb/gvdb-reader.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def22]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def23]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c: scope_hint: In function ‘sort_strv’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:86:3: warning[-Wanalyzer-null-argument]: use of NULL ‘strv’ where non-null expected
/usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here.
/usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
/usr/include/glib-2.0/gio/gioenums.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/giotypes.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/gio.h:28: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:27: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:35: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1237:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:899:3: note: in expansion of macro ‘g_return_val_if_fail’
/usr/include/glib-2.0/gobject/gtype.h:541:66: note: in expansion of macro ‘_G_TYPE_CIT’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:36:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:899:25: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1237:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:899:3: note: in expansion of macro ‘g_return_val_if_fail’
/usr/include/glib-2.0/gobject/gtype.h:541:66: note: in expansion of macro ‘_G_TYPE_CIT’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:36:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:899:25: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1237:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:348:3: note: in expansion of macro ‘g_return_val_if_fail’
/usr/include/glib-2.0/gobject/gtype.h:541:66: note: in expansion of macro ‘_G_TYPE_CIT’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:36:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:348:25: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib.h:64: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:348:3: note: in expansion of macro ‘g_return_val_if_fail’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:27: included_from: Included from here.
/usr/include/stdlib.h:970:13: note: argument 1 of ‘qsort’ must be non-null
#   84|   sort_strv (const char **strv)
#   85|   {
#   86|->   qsort (strv, g_strv_length ((char **) strv), sizeof (const char *), cmpstringp);
#   87|   }
#   88|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def24]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c: scope_hint: In function ‘permission_db_update’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:745:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
/usr/include/glib-2.0/glib/gmacros.h:1237:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gmessages.h:651:9: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:736:3: note: in expansion of macro ‘g_return_if_fail’
/usr/include/glib-2.0/gobject/gtype.h:541:66: note: in expansion of macro ‘_G_TYPE_CIT’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:36:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:736:21: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1237:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gmessages.h:651:9: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:736:3: note: in expansion of macro ‘g_return_if_fail’
/usr/include/glib-2.0/gobject/gtype.h:541:66: note: in expansion of macro ‘_G_TYPE_CIT’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:36:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:736:21: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1237:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:348:3: note: in expansion of macro ‘g_return_val_if_fail’
/usr/include/glib-2.0/gobject/gtype.h:541:66: note: in expansion of macro ‘_G_TYPE_CIT’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:36:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:348:25: note: in expansion of macro ‘PERMISSION_IS_DB’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:348:3: note: in expansion of macro ‘g_return_val_if_fail’
#  743|   
#  744|     ids = permission_db_list_ids (self);
#  745|->   for (i = 0; ids[i] != 0; i++)
#  746|       {
#  747|         g_autoptr(PermissionDbEntry) entry = permission_db_lookup (self, ids[i]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def25]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:758:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
/usr/include/glib-2.0/glib/gmacros.h:1237:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gmessages.h:651:9: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:736:3: note: in expansion of macro ‘g_return_if_fail’
/usr/include/glib-2.0/gobject/gtype.h:541:66: note: in expansion of macro ‘_G_TYPE_CIT’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:36:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:736:21: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1237:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gmessages.h:651:9: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:736:3: note: in expansion of macro ‘g_return_if_fail’
/usr/include/glib-2.0/gobject/gtype.h:541:66: note: in expansion of macro ‘_G_TYPE_CIT’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:36:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:736:21: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1237:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:348:3: note: in expansion of macro ‘g_return_val_if_fail’
/usr/include/glib-2.0/gobject/gtype.h:541:66: note: in expansion of macro ‘_G_TYPE_CIT’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:36:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:348:25: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1237:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:348:3: note: in expansion of macro ‘g_return_val_if_fail’
/usr/include/glib-2.0/gobject/gtype.h:541:66: note: in expansion of macro ‘_G_TYPE_CIT’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:36:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:348:25: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1237:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:400:3: note: in expansion of macro ‘g_return_val_if_fail’
/usr/include/glib-2.0/gobject/gtype.h:541:66: note: in expansion of macro ‘_G_TYPE_CIT’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.h:36:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:400:25: note: in expansion of macro ‘PERMISSION_IS_DB’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/permission-db.c:400:3: note: in expansion of macro ‘g_return_val_if_fail’
#  756|   
#  757|     apps = permission_db_list_apps (self);
#  758|->   for (i = 0; apps[i] != 0; i++)
#  759|       {
#  760|         g_auto(GStrv) app_ids = permission_db_list_ids_by_app (self, apps[i]);

Error: CLANG_WARNING: [#def26]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/document-portal/xdg-permission-store.c:404:7: warning[deadcode.DeadStores]: Value stored to 'old_entry' is never read
#  402|         g_variant_get (child, "{&s^a&s}", &child_app_id, &permissions);
#  403|   
#  404|->       old_entry = new_entry;
#  405|         new_entry = permission_db_entry_set_app_permissions (new_entry, child_app_id, (const char **) permissions);
#  406|   

Error: CPPCHECK_WARNING: [#def27]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/redhat-linux-build/document-portal/document-portal-dbus.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def28]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/redhat-linux-build/document-portal/permission-store-dbus.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def29]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/redhat-linux-build/src/geoclue-dbus.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def30]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/redhat-linux-build/src/xdp-background-dbus.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def31]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/redhat-linux-build/src/xdp-dbus.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def32]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/redhat-linux-build/src/xdp-impl-dbus.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def33]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/account.c:105:56: warning[core.NullDereference]: Access to field 'message' results in a dereference of a null pointer (loaded from variable 'error')
#  103|   
#  104|         if (ruri == NULL)
#  105|->         g_warning ("Failed to register %s: %s", image, error->message);
#  106|         else
#  107|           {

Error: CPPCHECK_WARNING: [#def34]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/background.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def35]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/background.c:675:3: warning[deadcode.DeadStores]: Value stored to 'thread' is never read
#  673|     monitor_context = g_main_context_new ();
#  674|   
#  675|->   thread = g_thread_new ("background monitor", background_monitor, NULL);
#  676|   }
#  677|   

Error: CPPCHECK_WARNING: [#def36]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/camera.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-190): [#def37]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/camera.c:165: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  163|     permission_items[2] = PW_PERMISSION_INIT (PW_ID_ANY, 0);
#  164|   
#  165|->   pw_client_update_permissions (pw_core_get_client(remote->core),
#  166|                                   G_N_ELEMENTS (permission_items),
#  167|                                   permission_items);

Error: CPPCHECK_WARNING: [#def38]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/device.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def39]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/documents.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def40]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/documents.c: scope_hint: In function ‘register_document’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/documents.c:84:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_path_get_dirname(g_file_get_path(g_file_new_for_uri(uri))), 2621440)’
/usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here.
/usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
/usr/include/glib-2.0/gio/gioenums.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/giotypes.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/gio.h:28: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/documents.c:30: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/documents.c:76:3: note: in expansion of macro ‘g_return_val_if_fail’
#   82|   
#   83|     if (flags & DOCUMENT_FLAG_FOR_SAVE)
#   84|->     fd = open (dirname, O_PATH | O_CLOEXEC);
#   85|     else
#   86|       fd = open (path, O_PATH | O_CLOEXEC);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def41]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/documents.c:86:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_file_get_path(g_file_new_for_uri(uri)), 2621440)’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/documents.c:76:3: note: in expansion of macro ‘g_return_val_if_fail’
#   84|       fd = open (dirname, O_PATH | O_CLOEXEC);
#   85|     else
#   86|->     fd = open (path, O_PATH | O_CLOEXEC);
#   87|   
#   88|     if (fd == -1)

Error: CPPCHECK_WARNING: [#def42]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/dynamic-launcher.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def43]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/dynamic-launcher.c:416:3: warning[deadcode.DeadStores]: Value stored to 'launcher_data' is never read
#  414|   
#  415|     g_debug ("Revoking install token %s", (char *)data);
#  416|->   launcher_data = get_launcher_data_and_revoke_token ((char *)data);
#  417|     g_free (data);
#  418|   

Error: CPPCHECK_WARNING: [#def44]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/file-chooser.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def45]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/file-chooser.c:127:64: warning[core.NullDereference]: Access to field 'message' results in a dereference of a null pointer (loaded from variable 'error')
#  125|             if (ruri == NULL)
#  126|               {
#  127|->               g_warning ("Failed to register %s: %s", uris[i], error->message);
#  128|                 continue;
#  129|               }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def46]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/file-chooser.c: scope_hint: In function ‘looks_like_document_portal_path’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/file-chooser.c:163:7: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/file-chooser.c:547:38: note: in expansion of macro ‘g_strdup’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/file-chooser.c: scope_hint: In function ‘looks_like_document_portal_path’
<built-in>: note: argument 1 of ‘__builtin_strstr’ must be non-null
#  161|       return FALSE;
#  162|   
#  163|->   p = strstr (path, "/doc/");
#  164|     if (!p)
#  165|       return FALSE;

Error: CPPCHECK_WARNING: [#def47]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/gamemode.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def48]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/global-shortcuts.c:520:3: warning[deadcode.DeadStores]: Value stored to 'options' is never read
#  518|       }
#  519|   
#  520|->   options = g_variant_builder_end (&options_builder);
#  521|   
#  522|     session = acquire_session (arg_session_handle, request);

Error: CPPCHECK_WARNING: [#def49]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/location.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def50]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/notification.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def51]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/open-uri.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def52]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/open-uri.c:785:7: warning[deadcode.DeadStores]: Value stored to 'fd' is never read
#  783|         g_object_set_data_full (G_OBJECT (request), "uri", g_strdup (uri), g_free);
#  784|         close (fd);
#  785|->       fd = -1;
#  786|         g_object_set_data (G_OBJECT (request), "fd", GINT_TO_POINTER (-1));
#  787|       }

Error: CPPCHECK_WARNING (CWE-190): [#def53]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/pipewire.c:106: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  104|     struct timespec roundtrip_timeout_spec = { ROUNDTRIP_TIMEOUT_SECS, 0 };
#  105|   
#  106|->   remote->sync_seq = pw_core_sync (remote->core, PW_ID_CORE, remote->sync_seq);
#  107|   
#  108|     /* Arm the roundtrip timeout before running the main loop, then clear it

Error: CPPCHECK_WARNING (CWE-190): [#def54]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/pipewire.c:110: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  108|     /* Arm the roundtrip timeout before running the main loop, then clear it
#  109|        right afterwards. */
#  110|->   pw_loop_update_timer (pw_main_loop_get_loop (remote->loop),
#  111|                           remote->roundtrip_timeout,
#  112|                           &roundtrip_timeout_spec,

Error: CPPCHECK_WARNING (CWE-190): [#def55]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/pipewire.c:118: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  116|     pw_main_loop_run (remote->loop);
#  117|   
#  118|->   pw_loop_update_timer (pw_main_loop_get_loop (remote->loop),
#  119|                           remote->roundtrip_timeout,
#  120|                           NULL,

Error: CPPCHECK_WARNING (CWE-190): [#def56]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/pipewire.c:202: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  200|   
#  201|     loop = pw_main_loop_get_loop (pipewire_source->remote->loop);
#  202|->   pw_loop_leave (loop);
#  203|   }
#  204|   

Error: CPPCHECK_WARNING (CWE-190): [#def57]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/pipewire.c:219: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  217|       {
#  218|         struct pw_loop *loop = pw_main_loop_get_loop (remote->loop);
#  219|->       pw_loop_destroy_source (loop, g_steal_pointer (&remote->roundtrip_timeout));
#  220|       }
#  221|   

Error: CPPCHECK_WARNING (CWE-190): [#def58]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/pipewire.c:261: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  259|     loop = pw_main_loop_get_loop (pipewire_source->remote->loop);
#  260|     g_source_add_unix_fd (&pipewire_source->base,
#  261|->                         pw_loop_get_fd (loop),
#  262|                           G_IO_IN | G_IO_ERR);
#  263|   

Error: CPPCHECK_WARNING (CWE-190): [#def59]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/pipewire.c:264: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  262|                           G_IO_IN | G_IO_ERR);
#  263|   
#  264|->   pw_loop_enter (loop);
#  265|     g_source_attach (&pipewire_source->base, NULL);
#  266|   

Error: CPPCHECK_WARNING (CWE-190): [#def60]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/pipewire.c:318: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  316|       }
#  317|   
#  318|->   remote->roundtrip_timeout = pw_loop_add_timer (pw_main_loop_get_loop (remote->loop),
#  319|                                                    on_roundtrip_timeout,
#  320|                                                    remote);

Error: CPPCHECK_WARNING (CWE-190): [#def61]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/pipewire.c:324: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  322|     remote->globals = g_hash_table_new_full (NULL, NULL, NULL, g_free);
#  323|   
#  324|->   pw_core_add_listener (remote->core,
#  325|                           &remote->core_listener,
#  326|                           &core_events,

Error: CPPCHECK_WARNING (CWE-190): [#def62]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/pipewire.c:332: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  330|                                                                 PW_VERSION_REGISTRY,
#  331|                                                                 0);
#  332|->   pw_registry_add_listener (remote->registry,
#  333|                               &remote->registry_listener,
#  334|                               &registry_events,

Error: CPPCHECK_WARNING: [#def63]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/portal-impl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def64]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/portal-impl.c:179:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'impl'
#  177|   
#  178|     if (!g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, error))
#  179|->     return FALSE;
#  180|   
#  181|     basename = g_path_get_basename (path);

Error: CPPCHECK_WARNING: [#def65]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/realtime.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def66]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/realtime.c:87:3: warning[deadcode.DeadStores]: Value stored to 'response' is never read
#   85|     g_autoptr(GVariant) response = NULL;
#   86|   
#   87|->   response = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object),
#   88|                                          result,
#   89|                                          &error);

Error: CLANG_WARNING: [#def67]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/restore-token.c:71:3: warning[deadcode.DeadStores]: Value stored to 'locker' is never read
#   69|     const char *key;
#   70|   
#   71|->   locker = g_mutex_locker_new (&transient_permissions_lock);
#   72|   
#   73|     if (!transient_permissions)

Error: CPPCHECK_WARNING: [#def68]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/screen-cast.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-190): [#def69]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/screen-cast.c:683: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  681|                         PERMISSION_ITEM (PW_ID_ANY, 0));
#  682|   
#  683|->   pw_client_update_permissions (pw_core_get_client(remote->core),
#  684|                                   permission_items->len,
#  685|                                   (const struct pw_permission *)permission_items->data);

Error: CPPCHECK_WARNING: [#def70]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/screenshot.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def71]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/screenshot.c:125:54: warning[core.NullDereference]: Access to field 'message' results in a dereference of a null pointer (loaded from variable 'error')
#  123|   
#  124|         if (ruri == NULL)
#  125|->         g_warning ("Failed to register %s: %s", uri, error->message);
#  126|         else
#  127|           g_variant_builder_add (&results, "{&sv}", "uri", g_variant_new_string (ruri));

Error: CLANG_WARNING: [#def72]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/screenshot.c:327:3: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
#  325|       }
#  326|   
#  327|->   g_debug ("Calling Screenshot with interactive=%d", interactive);
#  328|     xdp_dbus_impl_screenshot_call_screenshot (impl,
#  329|                                               request->id,

Error: CPPCHECK_WARNING: [#def73]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/sd-escape.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def74]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/sd-escape.c:327:33: warning[unix.Malloc]: Potential leak of memory pointed to by 'ans'
#  325|                           }
#  326|   
#  327|->                         return -EINVAL;
#  328|                   }
#  329|   

Error: CLANG_WARNING: [#def75]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/sd-escape.c:327:33: warning[unix.Malloc]: Potential leak of memory pointed to by 't'
#  325|                           }
#  326|   
#  327|->                         return -EINVAL;
#  328|                   }
#  329|   

Error: CPPCHECK_WARNING: [#def76]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/session.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def77]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/validate-icon.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def78]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/wallpaper.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def79]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/xdg-desktop-portal.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def80]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/xdp-utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def81]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/xdp-utils.c:760:3: warning[deadcode.DeadStores]: Value stored to 'fd' is never read
#  758|       }
#  759|   
#  760|->   fd = -1; /* fd is now owned by f */
#  761|   
#  762|     if (_xdp_parse_cgroup_file (f, &is_snap) == -1)

Error: CLANG_WARNING: [#def82]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/xdp-utils.c:1738:3: warning[deadcode.DeadStores]: Value stored to 'fd' is never read
# 1736|       return -errno;
# 1737|   
# 1738|->   fd = -1; /* fd is now owned by f */
# 1739|   
# 1740|     do {

Error: CLANG_WARNING: [#def83]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/src/xdp-utils.c:2133:3: warning[deadcode.DeadStores]: Value stored to 'guard' is never read
# 2131|     g_assert (app_info->kind == XDP_APP_INFO_KIND_FLATPAK);
# 2132|   
# 2133|->   guard = g_mutex_locker_new (&(app_info->u.flatpak.pidns_lock));
# 2134|   
# 2135|     if (app_info->u.flatpak.pidns_id != 0)

Error: CLANG_WARNING: [#def84]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/account.c:78:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
#   76|     g_autoptr(GVariant) ret = NULL;
#   77|   
#   78|->   ret = xdp_portal_get_user_information_finish (portal, result, &error);
#   79|     g_assert_error (error, G_IO_ERROR, G_IO_ERROR_FAILED);
#   80|   

Error: CPPCHECK_WARNING: [#def85]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/backend/account.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def86]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/backend/email.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def87]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/camera.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def88]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/can-use-fuse.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def89]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/email.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def90]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/filechooser.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def91]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/limited-portals.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def92]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/limited-portals.c: scope_hint: In function ‘global_setup’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/limited-portals.c:64:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘xdup(2)’
/usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here.
/usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
/usr/include/glib-2.0/gio/gioenums.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/giotypes.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/gio.h:28: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/limited-portals.c:6: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1357:36: note: in expansion of macro ‘_GLIB_AUTOPTR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:83:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1358:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:83:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:83:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/glib-autocleanups.h: scope_hint: In function ‘global_setup’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:83:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
#   62|       g_error ("Unable to duplicate fd %d: %s", oldfd, g_strerror (errno));
#   63|   
#   64|->   return newfd;
#   65|   }
#   66|   

Error: CPPCHECK_WARNING: [#def93]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/openuri.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def94]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def95]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c: scope_hint: In function ‘assert_doc_not_exist’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:137:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(make_doc_path(id,  basename,  app), 0)’
/usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here.
/usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
/usr/include/glib-2.0/gio/gioenums.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/giotypes.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/gio.h:28: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:12: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:184:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:205:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:208:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1358:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:96:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:96:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c: scope_hint: In function ‘assert_doc_not_exist’
#  135|     g_assert_cmpint (errno, ==, ENOENT);
#  136|   
#  137|->   fd = open (path, O_RDONLY);
#  138|     g_assert_cmpint (fd, ==, -1);
#  139|     g_assert_cmpint (errno, ==, ENOENT);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def96]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c: scope_hint: In function ‘assert_doc_dir_not_exist’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:153:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(make_doc_dir(id,  app), 0)’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:184:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:205:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:208:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1358:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:96:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:96:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c: scope_hint: In function ‘assert_doc_dir_not_exist’
#  151|     g_assert_cmpint (errno, ==, ENOENT);
#  152|   
#  153|->   fd = open (path, O_RDONLY);
#  154|     g_assert_cmpint (fd, ==, -1);
#  155|     g_assert_cmpint (errno, ==, ENOENT);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def97]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c: scope_hint: In function ‘assert_doc_dir_exist’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:168:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(make_doc_dir(id,  app), 0)’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:184:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:205:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:208:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1358:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:96:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:96:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c: scope_hint: In function ‘assert_doc_dir_exist’
#  166|     g_assert_cmpint (res, ==, 0);
#  167|   
#  168|->   fd = open (path, O_RDONLY);
#  169|     g_assert_cmpint (fd, !=, -1);
#  170|     close (fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def98]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c: scope_hint: In function ‘test_create_docs’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:517:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(&outdir, "doc1", 0), 2621440)’
#  515|     g_assert_no_error (error);
#  516|   
#  517|->   fd1 = open (path1, O_PATH | O_CLOEXEC);
#  518|     g_assert (fd1 >= 0);
#  519|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def99]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:520:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(&outdir, "doc1", 0), 2621440)’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
#  518|     g_assert (fd1 >= 0);
#  519|   
#  520|->   path2 = g_build_filename (outdir, basenames[1], NULL);
#  521|     g_file_set_contents (path2, basenames[1], -1, &error);
#  522|     g_assert_no_error (error);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def100]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:521:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(&outdir, "doc1", 0), 2621440)’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
#  519|   
#  520|     path2 = g_build_filename (outdir, basenames[1], NULL);
#  521|->   g_file_set_contents (path2, basenames[1], -1, &error);
#  522|     g_assert_no_error (error);
#  523|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def101]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:522:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(&outdir, "doc1", 0), 2621440)’
/usr/include/glib-2.0/glib/gtestutils.h:218:50: note: in definition of macro ‘g_assert_no_error’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:522:3: note: in expansion of macro ‘g_assert_no_error’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:522:3: note: in expansion of macro ‘g_assert_no_error’
/usr/include/glib-2.0/glib/gtestutils.h:218:50: note: in definition of macro ‘g_assert_no_error’
#  520|     path2 = g_build_filename (outdir, basenames[1], NULL);
#  521|     g_file_set_contents (path2, basenames[1], -1, &error);
#  522|->   g_assert_no_error (error);
#  523|   
#  524|     fd2 = open (path2, O_PATH | O_CLOEXEC);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def102]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:524:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(&outdir, "doc2", 0), 2621440)’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
#  522|     g_assert_no_error (error);
#  523|   
#  524|->   fd2 = open (path2, O_PATH | O_CLOEXEC);
#  525|     g_assert (fd2 >= 0);
#  526|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def103]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:527:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(&outdir, "doc2", 0), 2621440)’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:525:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:525:3: note: in expansion of macro ‘g_assert’
#  525|     g_assert (fd2 >= 0);
#  526|   
#  527|->   fd_list = g_unix_fd_list_new ();
#  528|     fd_ids[0] = g_unix_fd_list_append (fd_list, fd1, &error);
#  529|     g_assert_no_error (error);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def104]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:528:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(&outdir, "doc2", 0), 2621440)’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:525:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:525:3: note: in expansion of macro ‘g_assert’
#  526|   
#  527|     fd_list = g_unix_fd_list_new ();
#  528|->   fd_ids[0] = g_unix_fd_list_append (fd_list, fd1, &error);
#  529|     g_assert_no_error (error);
#  530|     close (fd1);

Error: CLANG_WARNING: [#def105]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-doc-portal.c:846:3: warning[deadcode.DeadStores]: Value stored to 'res' is never read
#  844|     g_object_unref (dbus);
#  845|   
#  846|->   res = rm_rf_dir (outdir_file, &error);
#  847|     g_assert_no_error (error);
#  848|   }

Error: CPPCHECK_WARNING: [#def106]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-permission-store.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def107]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-permission-store.c:193:3: warning[deadcode.DeadStores]: Value stored to 'res' is never read
#  191|     g_assert_true (g_variant_get_boolean (g_variant_get_variant (d)));
#  192|   
#  193|->   res = xdg_permission_store_call_delete_sync (permissions,
#  194|                                                  "TEST",
#  195|                                                  "test-resource",

Error: CLANG_WARNING: [#def108]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-permission-store.c:246:3: warning[deadcode.DeadStores]: Value stored to 'res' is never read
#  244|     g_assert_true (g_variant_get_boolean (g_variant_get_variant (d)));
#  245|   
#  246|->   res = xdg_permission_store_call_delete_sync (permissions,
#  247|                                                  "TEST",
#  248|                                                  "test-resource",

Error: CPPCHECK_WARNING: [#def109]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-portals.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def110]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-portals.c: scope_hint: In function ‘global_setup’
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-portals.c:63:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘xdup(2)’
/usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here.
/usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
/usr/include/glib-2.0/gio/gioenums.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/giotypes.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/gio.h:28: included_from: Included from here.
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/test-portals.c:5: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1357:36: note: in expansion of macro ‘_GLIB_AUTOPTR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:83:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1358:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:83:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:83:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/glib-autocleanups.h: scope_hint: In function ‘global_setup’
/usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/glib-2.0/glib/glib-autocleanups.h:83:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
#   61|       g_error ("Unable to duplicate fd %d: %s", oldfd, g_strerror (errno));
#   62|   
#   63|->   return newfd;
#   64|   }
#   65|   

Error: CPPCHECK_WARNING: [#def111]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/testdb.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def112]
xdg-desktop-portal-1.18.4-build/xdg-desktop-portal-1.18.4/tests/wallpaper.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-156.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namexdg-desktop-portal-1.18.4-1.fc41
store-results-to/tmp/tmpcvrst6fh/xdg-desktop-portal-1.18.4-1.fc41.tar.xz
time-created2024-07-03 18:24:46
time-finished2024-07-03 18:28:05
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpcvrst6fh/xdg-desktop-portal-1.18.4-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpcvrst6fh/xdg-desktop-portal-1.18.4-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9