File gimp-CVE-2025-10922-shim-3f9c7365.patch of Package gimp.41817

commit 3f9c7365925310f79cadd33545cb8f4275172b85
Author: Jehan <jehan@girinstud.io>
Date:   Fri Apr 2 01:57:10 2021 +0200

    libgimp: new gimp_plug_in_error_quark() / GIMP_PLUG_IN_ERROR.
    
    We heavily rely on GError in libgimp to retrieve plug-in error messages.
    In a lot of our code, we just use domain=0 for g_set_error*() functions
    and alike, but this is actually forbidden and results in GLib warnings.
    
    Some plug-ins instead create their own domain, other use G_FILE_ERROR
    nearly everywhere, even in some cases where the choice is really
    questionable. Since anyway this is mostly useful for passing the error
    message through, it is much nicer to provide a generic domain
    GIMP_PLUG_IN_ERROR, which can be used by all plug-ins when they don't
    want to bother with the error domain.

--- a/libgimp/gimpplugin.c
+++ b/libgimp/gimpplugin.c
@@ -24,6 +24,18 @@
 
 #include "gimp.h"
 
+/**
+ * gimp_plug_in_error_quark:
+ *
+ * Generic #GQuark error domain for plug-ins. Plug-ins are welcome to
+ * create their own domain when they want to handle advanced error
+ * handling. Often, you just want to pass an error message to the core.
+ * This domain can be used for such simple usage.
+ *
+ * See #GError for information on error domains.
+ */
+G_DEFINE_QUARK (gimp-plug-in-error-quark, gimp_plug_in_error)
+
 gboolean
 gimp_plugin_icon_register (const gchar  *procedure_name,
                            GimpIconType  icon_type,
diff -Nura a/libgimp/gimpplugin.h b/libgimp/gimpplugin.h
--- a/libgimp/gimpplugin.h	2021-12-20 04:48:34.000000000 +0800
+++ b/libgimp/gimpplugin.h	2025-11-27 14:02:50.775831034 +0800
@@ -29,12 +29,15 @@
 
 /* For information look into the C source or the html documentation */
 
+#define GIMP_PLUG_IN_ERROR           (gimp_plug_in_error_quark ())
 
 gboolean gimp_plugin_icon_register (const gchar  *procedure_name,
                                     GimpIconType  icon_type,
                                     const guint8 *icon_data);
 
 
+GQuark          gimp_plug_in_error_quark            (void);
+
 G_END_DECLS
 
 #endif /* __GIMP_PLUG_IN_H__ */
openSUSE Build Service is sponsored by