[gnome-control-center] printers: Check whether we have a device name
- From: Marek Kašík <mkasik src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] printers: Check whether we have a device name
- Date: Mon, 13 Jul 2015 09:22:43 +0000 (UTC)
commit b02f7722dd1a1ba921bc318660546d58757229c0
Author: Marek Kasik <mkasik redhat com>
Date: Tue May 26 16:34:39 2015 +0200
printers: Check whether we have a device name
Check whether we've been able to find a usable name of given device
to avoid dereference of NULL in canonicalize_device_name().
https://bugzilla.gnome.org/show_bug.cgi?id=749896
panels/printers/pp-utils.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/panels/printers/pp-utils.c b/panels/printers/pp-utils.c
index 85d68ab..ac2b9dd 100644
--- a/panels/printers/pp-utils.c
+++ b/panels/printers/pp-utils.c
@@ -4161,6 +4161,9 @@ canonicalize_device_name (GList *devices,
name = g_strdup (device->device_info);
}
+ if (name == NULL)
+ return NULL;
+
g_strstrip (name);
g_strcanon (name, ALLOWED_CHARACTERS, '-');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]