D11204: Support NTFS hidden files

David Faure noreply at phabricator.kde.org
Sun Mar 25 09:07:18 UTC 2018


dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> file_unix.cpp:418
> +    constexpr auto attrName = "system.ntfs_attrib_be";
> +    const auto filenameEncoded = QFile::encodeName(filename).data();
> +    auto length = getxattr(filenameEncoded, attrName, nullptr, 0);

Ouch, you can't call data() here, that's keeping a char* pointing to a deleted (temporary) QByteArray.
The .data() calls need to be inside the getxattr calls themselves (so that filenameEncoded is a QByteArray, which controls the lifetime of the 8bit string).

> rominf wrote in file_unix.cpp:422
> No, it's enough for array length to be `constexpr`.

Hmm, that makes a lot of sense, actually :-)

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D11204

To: rominf, #dolphin, #frameworks, markg, dfaure
Cc: dfaure, markg, elvisangelaccio, ltoscano, anthonyfieroni, broulik, #frameworks, #dolphin, michaelh, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180325/b25c7fe9/attachment.html>


More information about the Kde-frameworks-devel mailing list