From 73edad087f837e70cb3a44200efc3c52f790e93f Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Mon, 14 May 2012 15:29:30 +0200 Subject: [PATCH] pam: Avoid segfault on login without devices Avoid crashing if paths_array is NULL. https://bugs.freedesktop.org/show_bug.cgi?id=49904 --- pam/pam_fprintd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pam/pam_fprintd.c b/pam/pam_fprintd.c index 6dee6ae..52fce32 100644 --- a/pam/pam_fprintd.c +++ b/pam/pam_fprintd.c @@ -182,7 +182,9 @@ static DBusGProxy *open_device(pam_handle_t *pamh, DBusGConnection *connection, 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"); return NULL; }