[frameworks-kfilemetadata] [Bug 414227] Dolphin crashes in KFileMetaData::UserMetaData::queryAttributes() when retrieving metadata from dangling symlink

Ismael Asensio bugzilla_noreply at kde.org
Thu Dec 12 20:50:39 GMT 2019


https://bugs.kde.org/show_bug.cgi?id=414227

Ismael Asensio <isma.af at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|                            |https://commits.kde.org/kfi
                   |                            |lemetadata/4bb4195a6fc6841d
                   |                            |d9ce1d3f564fc122b6032d86
             Status|CONFIRMED                   |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Ismael Asensio <isma.af at gmail.com> ---
Git commit 4bb4195a6fc6841dd9ce1d3f564fc122b6032d86 by Ismael Asensio.
Committed on 12/12/2019 at 20:50.
Pushed by iasensio into branch 'master'.

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`

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

M  +11   -0    autotests/usermetadatawritertest.cpp
M  +1    -0    autotests/usermetadatawritertest.h
M  +6    -6    src/xattr_p.h

https://commits.kde.org/kfilemetadata/4bb4195a6fc6841dd9ce1d3f564fc122b6032d86

-- 
You are receiving this mail because:
You are on the CC list for the bug.



More information about the kfm-devel mailing list