[gnome-builder/gnome-builder-3-36] meson: fix a crash when building



commit 17c0aad459cc88330e054121d1c8f8d932e2e770
Author: Diego Escalante Urrelo <diegoe gnome org>
Date:   Sat Jun 27 03:30:07 2020 -0500

    meson: fix a crash when building
    
    When starting a build stage `on_build_stage_query()` would crash when
    the `IdeSubprocessLauncher` had a command line of more than 2 items and
    none of those were ninja or ninja-build.
    
    Found the crash when using a jhbuild pipeline, since its argv is
    `jhbuild run ninja`, the first loop got stuck on comparing `jhbuild`
    against ninja, ninja-build, and then infinity.
    
    The above because `g_strv_contains()` expects NULL terminated arrays,
    otherwise it will start accessing random memory and likely crash.

 src/plugins/meson/gbp-meson-pipeline-addin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/plugins/meson/gbp-meson-pipeline-addin.c b/src/plugins/meson/gbp-meson-pipeline-addin.c
index 694c027f9..6a5bef6c7 100644
--- a/src/plugins/meson/gbp-meson-pipeline-addin.c
+++ b/src/plugins/meson/gbp-meson-pipeline-addin.c
@@ -33,7 +33,7 @@ struct _GbpMesonPipelineAddin
   IdeObject parent_instance;
 };
 
-static const gchar *ninja_names[] = { "ninja", "ninja-build" };
+static const gchar *ninja_names[] = { "ninja", "ninja-build", NULL };
 
 static void
 on_build_stage_query (IdePipelineStage *stage,


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