[recipes] logging: Be safe against unset log domains



commit 120cfdfdfa350b7d97185a79bfbcf549666d5878
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jun 14 14:14:51 2017 -0400

    logging: Be safe against unset log domains
    
    This was causing crashes for debug logging out of gnome-autoar.

 src/gr-logging.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/gr-logging.c b/src/gr-logging.c
index d61e3c2..e3151cd 100644
--- a/src/gr-logging.c
+++ b/src/gr-logging.c
@@ -69,8 +69,9 @@ gr_log_writer (GLogLevelFlags   log_level,
                         }
                 }
 
-                if (!verbose_logging || strcmp (log_domain, G_LOG_DOMAIN) != 0) {
-                        if (strcmp (domains, "all") != 0 &&
+                if (!verbose_logging || g_strcmp0 (log_domain, G_LOG_DOMAIN) != 0) {
+                        if (domains != NULL &&
+                            strcmp (domains, "all") != 0 &&
                             (log_domain == NULL || !strstr (domains, log_domain)))
                                 return G_LOG_WRITER_HANDLED;
                 }


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