From 6192b79d891398d285a03fe52ffa609396274c51 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Wed, 4 Jun 2025 13:52:55 +0000 Subject: [PATCH] actions: Fix missing argument length check Resolves #14192 In procedure_commands_get_display_args (), one section missed a check for the argument array length before trying to access the index. This caused a crash if there were not enough arguments sent in for a Script-fu plug-in. This patch adds that array length check to prevent the crash. --- app/actions/procedure-commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/actions/procedure-commands.c b/app/actions/procedure-commands.c index d01a7ea1cb..813d1b0939 100644 --- a/app/actions/procedure-commands.c +++ b/app/actions/procedure-commands.c @@ -289,14 +289,14 @@ procedure_commands_get_display_args (GimpProcedure *procedure, return NULL; } } - else if (GIMP_IS_PARAM_SPEC_CORE_OBJECT_ARRAY (procedure->args[n_args])) + else if (gimp_value_array_length (args) > n_args && + GIMP_IS_PARAM_SPEC_CORE_OBJECT_ARRAY (procedure->args[n_args])) { GimpDrawable **drawables = NULL; gint n_drawables; GList *iter; gint i; - n_drawables = g_list_length (drawables_list); drawables = g_new0 (GimpDrawable *, n_drawables + 1);