[gimp] app: NULL log domain is not a bug.



commit 5fb057776847c576c94484bd431b87793c66f040
Author: Jehan <jehan girinstud io>
Date:   Tue Sep 22 17:52:32 2020 +0200

    app: NULL log domain is not a bug.
    
    A log error can have a NULL domain (apparently equivalent to "" default
    domain, according to g_log_set_handler() docs and we even explicitly
    list the NULL domain in the log_domains array in app/gimp-log.c.
    
    Yet our log handler was not expecting such possibility and was running a
    g_str_has_prefix() on NULL. Not sure why it aborted there. It might be
    because outputting a new warning inside the warning handler did not go
    well. Anyway this seems to fix our side of the bug #5358. The main fix
    will likely be on GEGL side (UMFPACK_ERROR_out_of_memory error).

 app/errors.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/app/errors.c b/app/errors.c
index e9756d333b..65a7141ab9 100644
--- a/app/errors.c
+++ b/app/errors.c
@@ -232,8 +232,9 @@ gimp_message_log_func (const gchar    *log_domain,
    * we need to keep the log domain information for third party
    * messages.
    */
-  if (! g_str_has_prefix (log_domain, "Gimp") &&
-      ! g_str_has_prefix (log_domain, "LibGimp"))
+  if (! log_domain ||
+      (! g_str_has_prefix (log_domain, "Gimp") &&
+       ! g_str_has_prefix (log_domain, "LibGimp")))
     msg_domain = log_domain;
 
   /* If debug policy requires it, WARNING and CRITICAL errors must be


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