Bug 615071 - invalid menu path crashes GIMP

Warn and skip the procedure instead of crashing. This is just to fix
the crash, a proper fix is about to follow.
This commit is contained in:
Sven Neumann 2010-04-07 21:05:38 +02:00
parent 6437acde64
commit 304db468d2
1 changed files with 16 additions and 3 deletions

View File

@ -438,10 +438,23 @@ plug_in_actions_add_proc (GimpActionGroup *group,
p1 = strrchr (path_original, '/'); p1 = strrchr (path_original, '/');
p2 = strrchr (path_translated, '/'); p2 = strrchr (path_translated, '/');
*p1 = '\0'; if (p1 && p2)
*p2 = '\0'; {
*p1 = '\0';
*p2 = '\0';
label = p2 + 1; label = p2 + 1;
}
else
{
g_warning ("bad menu path for procedure \"%s\": \"%s\"",
gimp_object_get_name (proc), path_original);
g_free (path_original);
g_free (path_translated);
return;
}
} }
entry.name = gimp_object_get_name (proc); entry.name = gimp_object_get_name (proc);