From 1fa3bc8e51431f047e0197d7f23532d1b5df847d Mon Sep 17 00:00:00 2001 From: Jehan Date: Tue, 28 Oct 2025 13:04:34 +0100 Subject: [PATCH] Issue #14014: do not allow NULL or empty parasite name. This reverts commit 7b023177a8 and reimplement it as a CRITICAL because if this happens, a bug has occured. If so, we don't want to hide the bug, we want to be warned of it so that we can investigate further. Clearly it should simply not be possible to create a parasite with a NULL name. First if we look at xcf_load_parasite(), we were already returning early when the name was NULL. Also even the constructor gimp_parasite_new() has an early check and will return NULL on a NULL or empty name. So the question is: how come we had a parasite with NULL name (if that is really the problem)? I don't have the answer to this and it's possible that this bug had already been fixed somehow. But in any case, if it happens again, we'll want this CRITICAL to run. --- app/core/gimpparasitelist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/core/gimpparasitelist.c b/app/core/gimpparasitelist.c index fb2821dc4b..991e360e8b 100644 --- a/app/core/gimpparasitelist.c +++ b/app/core/gimpparasitelist.c @@ -328,13 +328,13 @@ gimp_parasite_list_remove (GimpParasiteList *list, const gchar *name) { g_return_if_fail (GIMP_IS_PARASITE_LIST (list)); + g_return_if_fail (name != NULL && strlen (name) > 0); if (list->table) { - GimpParasite *parasite = NULL; + GimpParasite *parasite; - if (name != NULL) - parasite = (GimpParasite *) gimp_parasite_list_find (list, name); + parasite = (GimpParasite *) gimp_parasite_list_find (list, name); if (parasite) {