xattr: fix crash on dangling symlinks
Summary:
When requesting metadata on a dangling symlink, the framestack ends up calling
k_queryAttributes() with the symlink path, where the listxattr syscall
returns size==-1 and errno==ENOENT (No such file or directory).
This case was not covered before, and provoked a segfault on QByteArray.
Full traceback on: https://bugs.kde.org/show_bug.cgi?id=414227
It might be also a good idea to always protect the function when size==-1
BUG: 414227
Test Plan:
- bin/usermetadatawritertest : added test
- On dolphin, with panel information open, hover over a dangling symlink
Reviewers: astippich, bruns
Reviewed By: bruns
Subscribers: bruns, kde-frameworks-devel, Baloo
Tags: Frameworks, Baloo
Differential Revision: https://phabricator.kde.org/D25414