Commit dc6d16a2 authored by Diego Escalante Urrelo's avatar Diego Escalante Urrelo 🍄 Committed by Christian Hergert

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.
parent 7a43de2c
......@@ -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,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment