Blob Blame History Raw
From 9647c954c34b3547ff260c4a02d2f7ed5ef47ff7 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Sun, 14 Apr 2019 23:38:39 -0400
Subject: [PATCH] Fix a system-helper crash

As seen in https://github.com/flatpak/flatpak/issues/2829,
the system-helper crashes while trying to access an as
parameter as s. Looking at the likely culprits for this,
I find that the permission check for Deploy has an off-by-one
error where it tries to get the installation, but
passes the offset for the previous_ids  parameter.
---
 system-helper/flatpak-system-helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/system-helper/flatpak-system-helper.c b/system-helper/flatpak-system-helper.c
index 59cc65c5b..b8deab755 100644
--- a/system-helper/flatpak-system-helper.c
+++ b/system-helper/flatpak-system-helper.c
@@ -1885,7 +1885,7 @@ flatpak_authorize_method_handler (GDBusInterfaceSkeleton *interface,
       g_variant_get_child (parameters, 1, "u", &flags);
       g_variant_get_child (parameters, 2, "&s", &ref);
       g_variant_get_child (parameters, 3, "&s", &origin);
-      g_variant_get_child (parameters, 5, "&s", &installation);
+      g_variant_get_child (parameters, 6, "&s", &installation);
 
       /* For metadata updates, redirect to the metadata-update action which
        * should basically always be allowed */