summaryrefslogtreecommitdiff
authorDidier Raboud <odyx@debian.org>2012-05-14 13:29:30 (GMT)
committer Bastien Nocera <hadess@hadess.net>2012-05-14 14:09:25 (GMT)
commit73edad087f837e70cb3a44200efc3c52f790e93f (patch) (side-by-side diff)
treebed738a36f2df40e3e936d7c6420a4436a343d5f
parent4c120e487b7e7794966c569e35ad8ba3de78a0cc (diff)
downloadfprintd-master.zip
fprintd-master.tar.gz
pam: Avoid segfault on login without devicesHEADmaster
Avoid crashing if paths_array is NULL. https://bugs.freedesktop.org/show_bug.cgi?id=49904
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--pam/pam_fprintd.c4
1 files changed, 3 insertions, 1 deletions
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;
}