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
This commit is contained in:
Marek Kasik 2015-05-26 16:34:39 +02:00
parent 61a0a8c633
commit b02f7722dd

View file

@ -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, '-');