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.
This commit is contained in:
parent
d320b85115
commit
1fa3bc8e51
1 changed files with 3 additions and 3 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue