mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
device: Fix crash on exit
Fix a possible crash when an fprintd client disappears. If the client requested for the device to be released, then, without waiting for the reply of that release, disappeared from the bus, we would try to close it a second time, accessing a function pointer that didn't exist anymore. See https://bugzilla.redhat.com/show_bug.cgi?id=1515720
This commit is contained in:
16
src/device.c
16
src/device.c
@ -558,7 +558,12 @@ _fprint_device_client_vanished (GDBusConnection *connection,
|
||||
|
||||
/* Close the claimed device as well */
|
||||
if (priv->dev) {
|
||||
fp_async_dev_close (priv->dev, action_stop_cb, &done);
|
||||
struct fp_dev *dev;
|
||||
|
||||
dev = priv->dev;
|
||||
priv->dev = NULL;
|
||||
|
||||
fp_async_dev_close (dev, action_stop_cb, &done);
|
||||
while (done == FALSE)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
}
|
||||
@ -737,8 +742,13 @@ static void fprint_device_release(FprintDevice *rdev,
|
||||
}
|
||||
|
||||
session->context_release_device = context;
|
||||
if (priv->dev)
|
||||
fp_async_dev_close(priv->dev, dev_close_cb, rdev);
|
||||
if (priv->dev) {
|
||||
struct fp_dev *dev;
|
||||
|
||||
dev = priv->dev;
|
||||
priv->dev = NULL;
|
||||
fp_async_dev_close(dev, dev_close_cb, rdev);
|
||||
}
|
||||
}
|
||||
|
||||
static void verify_cb(struct fp_dev *dev, int r, struct fp_img *img,
|
||||
|
||||
Reference in New Issue
Block a user