From 806fb8d90873b59022f2c6f117f894a67b67e4fe Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval Date: Fri, 21 Feb 2025 18:35:54 +0100 Subject: [PATCH] permission-db: Do not crash on NULL child_app_id The callers of this function check whether the return value is NULL. Fixes: https://github.com/flatpak/xdg-desktop-portal/issues/1616 --- document-portal/permission-db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/document-portal/permission-db.c b/document-portal/permission-db.c index 493b35125..0b826d93a 100644 --- a/document-portal/permission-db.c +++ b/document-portal/permission-db.c @@ -1030,7 +1030,7 @@ permission_db_entry_get_permissions_variant (PermissionDbEntry *entry, child = g_variant_get_child_value (app_array, m); g_variant_get_child (child, 0, "&s", &child_app_id); - cmp = strcmp (app_id, child_app_id); + cmp = g_strcmp0 (app_id, child_app_id); if (cmp == 0) { res = g_variant_get_child_value (child, 1);