summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2014-01-14 09:19:49 +0100
committerMartin Pitt <martinpitt@gnome.org>2014-01-14 09:19:49 +0100
commitf6bce1a3cfaca39d5992b89b10f90b26a388dbfe (patch)
treee8a0ea65ff20fc236c2176c6f8413f0ffd6a4993
parentd7ff8838faf317284c78a59f06374c958278b156 (diff)
downloadudisks-f6bce1a3cfaca39d5992b89b10f90b26a388dbfe.tar.gz
Fix crash when waiting for loop device
If for some reason we're unable to get a UDisksObject instance, just bail out and let udisks_daemon_wait_for_object_sync() continue with the loop and call the wait_func again after a short break. Hopefully the object we're looking for will arrive until then. https://bugs.freedesktop.org/show_bug.cgi?id=72956 Signed-off-by: Martin Pitt <martinpitt@gnome.org>
-rw-r--r--src/udiskslinuxmanager.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/udiskslinuxmanager.c b/src/udiskslinuxmanager.c
index 2e2034f..d15eba6 100644
--- a/src/udiskslinuxmanager.c
+++ b/src/udiskslinuxmanager.c
@@ -230,6 +230,8 @@ wait_for_loop_object (UDisksDaemon *daemon,
/* First see if we have the right loop object */
object = udisks_daemon_find_block_by_device_file (daemon, data->loop_device);
+ if (object == NULL)
+ goto out;
block = udisks_object_peek_block (object);
loop = udisks_object_peek_loop (object);
if (block == NULL || loop == NULL)