Skip to content
Commit a3b9c773 authored by Simeon Bird's avatar Simeon Bird
Browse files

Filewatch: do not try to watch empty paths.

In slotDeviceMounted, we find the mountPath to watch using
entry->MountPath. However, if the removable device could not be viewed as
a Solid::DeviceType::StorageAccess, mountPath returns QString().

We would then try to watch an empty folder.
In shouldFolderBeWatched we would try to split the empty string,
resulting in an empty list, and take the last component of this list,
leading to an invalid pointer and a crash.

The fix is two-fold:
First, check for empty mountPath in slotDeviceMounted and do not try to
watch it.
Second, check that the split path is not empty in shouldFolderBeWatched
before taking the last component.

BUG: 312423
FIXED-IN: 4.10.1
REVIEW: 108985
parent fe79c33a
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