xdg-desktop-portal-1.19.0-1.fc42

List of Findings

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

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/document-portal.c: scope_hint: In function ‘document_add_full’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/document-portal.c:847:19: warning[-Wanalyzer-null-argument]: use of NULL ‘dirname’ where non-null expected
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/document-store.h:7: included_from: Included from here.
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/document-portal.c:41: 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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/document-portal.c:37: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-utils.h:113:3: note: in expansion of macro ‘g_assert’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-utils.h: scope_hint: In function ‘document_add_full’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/document-portal.c:35: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/document-portal.c:454:3: note: in expansion of macro ‘g_assert’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/document-portal.c:464:3: note: in expansion of macro ‘XDP_AUTOLOCK’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/document-portal.c: scope_hint: In function ‘document_add_full’
/usr/include/glib-2.0/glib/gmacros.h:1365:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:102:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:102:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:102:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/document-portal.c:844:27: note: in expansion of macro ‘g_strdup’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/document-portal.c:27: included_from: Included from here.
/usr/include/sys/stat.h:327:12: note: argument 1 of ‘lstat’ must be non-null
#  845|                 else
#  846|                   dirname = g_path_get_dirname (path);
#  847|->               if (lstat (dirname, &real_dir_st_bufs[i]) != 0)
#  848|                   {
#  849|                     g_set_error (error,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/document-portal.c: scope_hint: In function ‘portal_lookup’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/document-portal.c:1228:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(filename, 2621440)’
# 1226|     g_variant_get (parameters, "(^&ay)", &filename);
# 1227|   
# 1228|->   fd = open (filename, O_PATH | O_CLOEXEC);
# 1229|     if (fd == -1)
# 1230|       {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/file-transfer.c: scope_hint: In function ‘file_transfer_execute’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/file-transfer.c:298: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/file-transfer.c:38: included_from: Included from here.
/usr/include/glib-2.0/glib/garray.h:149:46: note: in definition of macro ‘g_ptr_array_index’
#  296|         ExportedFile *file = (ExportedFile*)g_ptr_array_index (transfer->files, i);
#  297|   
#  298|->       fds[i] = open (file->path, O_PATH | O_CLOEXEC);
#  299|         if (fds[i] == -1)
#  300|           {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def5]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/gvdb/gvdb-builder.c: scope_hint: In function ‘file_builder_allocate_for_hash’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/gvdb/gvdb-builder.h:23: included_from: Included from here.
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/gvdb/gvdb-builder.c:20: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/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: GCC_ANALYZER_WARNING (CWE-688): [#def6]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c: scope_hint: In function ‘sort_strv’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:88: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:29: included_from: Included from here.
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:37: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1243:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:901: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:38:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:901:25: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1243:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:901: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:38:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:901:25: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1243:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:350: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:38:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:350: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:350:3: note: in expansion of macro ‘g_return_val_if_fail’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:29: included_from: Included from here.
/usr/include/stdlib.h:970:13: note: argument 1 of ‘qsort’ must be non-null
#   86|   sort_strv (const char **strv)
#   87|   {
#   88|->   qsort (strv, g_strv_length ((char **) strv), sizeof (const char *), cmpstringp);
#   89|   }
#   90|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def7]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c: scope_hint: In function ‘permission_db_update’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:747:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
/usr/include/glib-2.0/glib/gmacros.h:1243:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:738: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:38:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:738:21: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1243:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:738: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:38:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:738:21: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1243:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:350: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:38:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:350:25: note: in expansion of macro ‘PERMISSION_IS_DB’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:350:3: note: in expansion of macro ‘g_return_val_if_fail’
#  745|   
#  746|     ids = permission_db_list_ids (self);
#  747|->   for (i = 0; ids[i] != 0; i++)
#  748|       {
#  749|         g_autoptr(PermissionDbEntry) entry = permission_db_lookup (self, ids[i]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def8]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:760:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
/usr/include/glib-2.0/glib/gmacros.h:1243:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:738: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:38:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:738:21: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1243:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:738: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:38:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:738:21: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1243:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:350: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:38:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:350:25: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1243:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:350: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:38:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:350:25: note: in expansion of macro ‘PERMISSION_IS_DB’
/usr/include/glib-2.0/glib/gmacros.h:1243:8: note: in definition of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:402: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.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.h:38:32: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:402:25: note: in expansion of macro ‘PERMISSION_IS_DB’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/document-portal/permission-db.c:402:3: note: in expansion of macro ‘g_return_val_if_fail’
#  758|   
#  759|     apps = permission_db_list_apps (self);
#  760|->   for (i = 0; apps[i] != 0; i++)
#  761|       {
#  762|         g_auto(GStrv) app_ids = permission_db_list_ids_by_app (self, apps[i]);

Error: CPPCHECK_WARNING (CWE-190): [#def9]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/camera.c:254: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  252|     permission_items[2] = PW_PERMISSION_INIT (PW_ID_ANY, 0);
#  253|   
#  254|->   pw_client_update_permissions (pw_core_get_client(remote->core),
#  255|                                   G_N_ELEMENTS (permission_items),
#  256|                                   permission_items);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def10]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/documents.c: scope_hint: In function ‘register_document’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/documents.c:93: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.19.0-build/xdg-desktop-portal-1.19.0/src/documents.c:32: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/src/documents.c:85:3: note: in expansion of macro ‘g_return_val_if_fail’
#   91|   
#   92|     if (flags & DOCUMENT_FLAG_FOR_SAVE)
#   93|->     fd = open (dirname, O_PATH | O_CLOEXEC);
#   94|     else
#   95|       fd = open (path, O_PATH | O_CLOEXEC);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def11]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/documents.c:95: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:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/src/documents.c:85:3: note: in expansion of macro ‘g_return_val_if_fail’
#   93|       fd = open (dirname, O_PATH | O_CLOEXEC);
#   94|     else
#   95|->     fd = open (path, O_PATH | O_CLOEXEC);
#   96|   
#   97|     if (fd == -1)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def12]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/file-chooser.c: scope_hint: In function ‘looks_like_document_portal_path’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/file-chooser.c:173:7: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/file-chooser.c:557:38: note: in expansion of macro ‘g_strdup’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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
#  171|       return FALSE;
#  172|   
#  173|->   p = strstr (path, "/doc/");
#  174|     if (!p)
#  175|       return FALSE;

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

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

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

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

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

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

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

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

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

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

Error: CPPCHECK_WARNING (CWE-190): [#def23]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/screen-cast.c:690: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  688|                         PERMISSION_ITEM (PW_ID_ANY, 0));
#  689|   
#  690|->   pw_client_update_permissions (pw_core_get_client(remote->core),
#  691|                                   permission_items->len,
#  692|                                   (const struct pw_permission *)permission_items->data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-flatpak.c: scope_hint: In function ‘get_bwrap_pidfd’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-flatpak.c:565:10: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/proc")’
/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/json-glib-1.0/json-glib/json-types.h:32: included_from: Included from here.
/usr/include/json-glib-1.0/json-glib/json-glib.h:29: included_from: Included from here.
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-flatpak.c:28: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-flatpak.c:505:3: note: in expansion of macro ‘g_return_val_if_fail’
/usr/include/json-glib-1.0/json-glib/json-types.h:74:42: note: in expansion of macro ‘JSON_NODE_HOLDS’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-flatpak.c:531:8: note: in expansion of macro ‘JSON_NODE_HOLDS_OBJECT’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-flatpak.c: scope_hint: In function ‘get_bwrap_pidfd’
/usr/include/glib-2.0/glib/gmacros.h:1365:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/json-glib-1.0/json-glib/json-types.h:533:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/json-glib-1.0/json-glib/json-types.h:533:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-flatpak.c: scope_hint: In function ‘get_bwrap_pidfd’
/usr/include/glib-2.0/glib/gmacros.h:1365:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/json-glib-1.0/json-glib/json-parser.h:243:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
/usr/include/json-glib-1.0/json-glib/json-parser.h:243:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-flatpak.c: scope_hint: In function ‘get_bwrap_pidfd’
#  563|       return -1;
#  564|   
#  565|->   proc = opendir ("/proc");
#  566|     if (proc == NULL)
#  567|       {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def25]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-snap.c: scope_hint: In function ‘pid_is_snap’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-snap.c:106:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_strdup_printf("/proc/%u/cgroup", (unsigned int)pid), 524544)’
/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.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-utils.h:31: included_from: Included from here.
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-private.h:22: included_from: Included from here.
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-snap-private.h:22: included_from: Included from here.
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-snap.c:28: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/src/xdp-app-info-snap.c:103:3: note: in expansion of macro ‘g_return_val_if_fail’
#  104|   
#  105|     cgroup_path = g_strdup_printf ("/proc/%u/cgroup", (guint) pid);
#  106|->   fd = open (cgroup_path, O_RDONLY | O_CLOEXEC | O_NOCTTY);
#  107|     if (fd == -1)
#  108|       {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def26]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/tests/limited-portals.c: scope_hint: In function ‘global_setup’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/tests/limited-portals.c:65:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘xdup(2)’
#   63|       g_error ("Unable to duplicate fd %d: %s", oldfd, g_strerror (errno));
#   64|   
#   65|->   return newfd;
#   66|   }
#   67|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def27]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c: scope_hint: In function ‘assert_doc_not_exist’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:12: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:184:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:205:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:208:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1365:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1381: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:1381: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.19.0-build/xdg-desktop-portal-1.19.0/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): [#def28]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c: scope_hint: In function ‘assert_doc_dir_not_exist’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:184:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:205:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:208:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1365:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1381: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:1381: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.19.0-build/xdg-desktop-portal-1.19.0/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): [#def29]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c: scope_hint: In function ‘assert_doc_dir_exist’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:184:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:205:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:208:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1365:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1381: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:1381: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.19.0-build/xdg-desktop-portal-1.19.0/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): [#def30]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c: scope_hint: In function ‘test_create_docs’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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): [#def31]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/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): [#def32]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/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): [#def33]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:522:3: note: in expansion of macro ‘g_assert_no_error’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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): [#def34]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/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): [#def35]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:525:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/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): [#def36]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/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:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:518:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/tests/test-doc-portal.c:525:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1249:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1250: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.19.0-build/xdg-desktop-portal-1.19.0/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: GCC_ANALYZER_WARNING (CWE-775): [#def37]
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/tests/test-portals.c: scope_hint: In function ‘global_setup’
xdg-desktop-portal-1.19.0-build/xdg-desktop-portal-1.19.0/tests/test-portals.c:64:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘xdup(2)’
#   62|       g_error ("Unable to duplicate fd %d: %s", oldfd, g_strerror (errno));
#   63|   
#   64|->   return newfd;
#   65|   }
#   66|   

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-190.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namexdg-desktop-portal-1.19.0-1.fc42
store-results-to/tmp/tmpuyi8d_ty/xdg-desktop-portal-1.19.0-1.fc42.tar.xz
time-created2024-11-13 03:45:46
time-finished2024-11-13 03:49:40
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpuyi8d_ty/xdg-desktop-portal-1.19.0-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpuyi8d_ty/xdg-desktop-portal-1.19.0-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9