[gnome-builder] meson: fix a crash when building
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] meson: fix a crash when building
- Date: Sat, 27 Jun 2020 19:48:11 +0000 (UTC)
commit dc6d16a2f543653691fe60777f5d692085f9c2d8
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]