From 22aecbf47a50da39cc72af8f6771393fa98d4263 Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" Date: Tue, 16 May 2023 19:23:44 +0000 Subject: [PATCH] missing NULL terminator in set_config_x The scheme function set_config_x allocates a list that is freed with g_strfreev() on unwind. The latter expects a NULL-terminated list of pointers, but the null pointer is not added. This patch fixes it. Closes-bug: lp-2019899 --- libgeda/src/scheme_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgeda/src/scheme_config.c b/libgeda/src/scheme_config.c index 34e6d3e15..be6d25a3d 100644 --- a/libgeda/src/scheme_config.c +++ b/libgeda/src/scheme_config.c @@ -961,7 +961,7 @@ SCM_DEFINE (set_config_x, "%set-config!", 4, 0, 0, int i = 0; if (scm_is_string (first_s)) { - gchar **value = g_new0 (gchar *, len); + gchar **value = g_new0 (gchar *, len + 1); /* null-terminated! */ scm_dynwind_unwind_handler ((void (*)(void *)) g_strfreev, value, SCM_F_WIND_EXPLICITLY); for (curr_s = value_s; !scm_is_null (curr_s); curr_s = scm_cdr (curr_s)) { -- 2.11.4.GIT