[Nepomuk] Review Request 108985: Filewatch: do not try to watch empty paths

Simeon Bird bladud at gmail.com
Sat Feb 16 19:07:37 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/108985/
-----------------------------------------------------------

Review request for Nepomuk and Vishesh Handa.


Description
-------

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


This addresses bug 312423.
    http://bugs.kde.org/show_bug.cgi?id=312423


Diffs
-----

  services/fileindexer/fileindexerconfig.cpp 13a14cfeb8dfe715301d912c78adeb691482c6b0 
  services/filewatch/nepomukfilewatch.cpp 392f31d88a534cc69245f6d09e73e7838f6ca148 

Diff: http://git.reviewboard.kde.org/r/108985/diff/


Testing
-------

Compile only


Thanks,

Simeon Bird

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/nepomuk/attachments/20130216/a27bfdc8/attachment.html>


More information about the Nepomuk mailing list