mirror of
https://github.com/flatpak/flatpak.git
synced 2026-10-20 22:55:16 -04:00
xdg_app_installation_list_remote_refs_sync: Don't crash on weird refs
This commit is contained in:
1 parent
cd2c5af974
commit
a1b5bb1507
2 files changed
+8
-3
No files matched your search
@@ -1052,9 +1052,12 @@ xdg_app_installation_list_remote_refs_sync (XdgAppInstallation *self,
|
||||
{
|
||||
const char *refspec = key;
|
||||
const char *checksum = value;
|
||||
XdgAppRemoteRef *ref;
|
||||
|
||||
g_ptr_array_add (refs,
|
||||
xdg_app_remote_ref_new (refspec, checksum, remote_name));
|
||||
ref = xdg_app_remote_ref_new (refspec, checksum, remote_name);
|
||||
|
||||
if (ref)
|
||||
g_ptr_array_add (refs, ref);
|
||||
}
|
||||
|
||||
return g_steal_pointer (&refs);
|
||||
|
||||
@@ -137,7 +137,9 @@ xdg_app_remote_ref_new (const char *full_ref,
|
||||
g_auto(GStrv) parts = NULL;
|
||||
XdgAppRemoteRef *ref;
|
||||
|
||||
parts = g_strsplit (full_ref, "/", -1);
|
||||
parts = xdg_app_decompose_ref (full_ref, NULL);
|
||||
if (parts == NULL)
|
||||
return NULL;
|
||||
|
||||
if (strcmp (parts[0], "app") != 0)
|
||||
kind = XDG_APP_REF_KIND_RUNTIME;
|
||||
|
||||
Reference in new issue
Block a user