Commit 73edad08 authored by Didier Raboud's avatar Didier Raboud Committed by Bastien Nocera
Browse files

pam: Avoid segfault on login without devices

Avoid crashing if paths_array is NULL.
parent 4c120e48
...@@ -182,7 +182,9 @@ static DBusGProxy *open_device(pam_handle_t *pamh, DBusGConnection *connection, ...@@ -182,7 +182,9 @@ static DBusGProxy *open_device(pam_handle_t *pamh, DBusGConnection *connection,
return NULL; return NULL;
} }
if (paths_array == NULL) { if (paths_array == NULL || paths_array->len == 0) {
if (paths_array != NULL)
g_ptr_array_free (paths_array, TRUE);
D(pamh, "No devices found\n"); D(pamh, "No devices found\n");
return NULL; return NULL;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment