[gnome-control-center] printers: Fix crasher if a or b are NULL in cmp
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] printers: Fix crasher if a or b are NULL in cmp
- Date: Thu, 20 Oct 2011 15:11:09 +0000 (UTC)
commit e9f95249a9a247cbff758a0a705b7309c1d8628f
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]