[gnome-builder] flatpak: Refresh argv pointer on every insert



commit b69633a21f6d038879f44a91e8db959346125acf
Author: Matthew Leeds <mleeds redhat com>
Date:   Sun Mar 12 22:41:21 2017 -0500

    flatpak: Refresh argv pointer on every insert
    
    Builder sometimes segfaults on g_strv_contains in the flatpak subprocess
    launcher when the argv pointer is no longer valid (because a previous
    insert caused the array to expand). This commit gets the argv pointer
    on every loop iteration so we know it's valid.

 plugins/flatpak/gbp-flatpak-subprocess-launcher.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/plugins/flatpak/gbp-flatpak-subprocess-launcher.c 
b/plugins/flatpak/gbp-flatpak-subprocess-launcher.c
index a350661..7d0d584 100644
--- a/plugins/flatpak/gbp-flatpak-subprocess-launcher.c
+++ b/plugins/flatpak/gbp-flatpak-subprocess-launcher.c
@@ -86,6 +86,7 @@ gbp_flatpak_subprocess_launcher_spawn (IdeSubprocessLauncher  *launcher,
       for (guint i = 0; envp[i] != NULL; i++)
         {
           g_autofree gchar *arg = g_strdup_printf ("--env=%s", envp[i]);
+          argv = ide_subprocess_launcher_get_argv (launcher);
           if (!g_strv_contains (argv, arg))
             ide_subprocess_launcher_insert_argv (launcher, argpos, arg);
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]