[gnome-control-center/gnome-3-2] printers: Fix crasher if a or b are NULL in cmp



commit a501fd45d81db90f86a66e1da6c1d9a2574bfc05
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Oct 20 15:36:04 2011 +0100

    printers: Fix crasher if a or b are NULL in cmp
    
    If a or b are NULL then (c && d) fails, and both a_normalized
    and b_normalized are left uninitialised, possibly causing a crash
    when we try to free them later.

 panels/printers/pp-utils.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/panels/printers/pp-utils.c b/panels/printers/pp-utils.c
index 66c3343..c89c4e4 100644
--- a/panels/printers/pp-utils.c
+++ b/panels/printers/pp-utils.c
@@ -593,8 +593,8 @@ item_cmp (gconstpointer a,
   PPDItem *d = (PPDItem *) b;
   glong   a_number;
   glong   b_number;
-  gchar  *a_normalized;
-  gchar  *b_normalized;
+  gchar  *a_normalized = NULL;
+  gchar  *b_normalized = NULL;
   gchar **av = NULL;
   gchar **bv = NULL;
   gint    a_length = 0;



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