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:
parent
61a0a8c633
commit
b02f7722dd
1 changed files with 3 additions and 0 deletions
|
@ -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, '-');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue