[gimp] Bug 615071 - invalid menu path crashes GIMP



commit 9de1d97fb3d22a30173cdc560723311557aa9334
Author: Sven Neumann <sven gimp org>
Date:   Wed Apr 7 21:27:51 2010 +0200

    Bug 615071 - invalid menu path crashes GIMP
    
    Check that gimp-plugin-menu-register is only used with procedures
    that have registered with a label.

 app/plug-in/gimpplugin.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c
index 8631ea0..d371332 100644
--- a/app/plug-in/gimpplugin.c
+++ b/app/plug-in/gimpplugin.c
@@ -929,6 +929,19 @@ gimp_plug_in_menu_register (GimpPlugIn  *plug_in,
       return FALSE;
     }
 
+  if (! strlen (proc->menu_label))
+    {
+      gimp_message (plug_in->manager->gimp, NULL, GIMP_MESSAGE_ERROR,
+                    "Plug-in \"%s\"\n(%s)\n"
+                    "attempted to register the procedure \"%s\" "
+                    "in the menu \"%s\", but the procedure has no label.  "
+                    "This is not allowed.",
+                    gimp_object_get_name (plug_in),
+                    gimp_filename_to_utf8 (plug_in->prog),
+                    proc_name, menu_path);
+
+      return FALSE;
+    }
   if (! gimp_plug_in_procedure_add_menu_path (proc, menu_path, &error))
     {
       gimp_message_literal (plug_in->manager->gimp, NULL, GIMP_MESSAGE_ERROR,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]