D17816: Support for xattrs on kio copy/move

Cochise César noreply at phabricator.kde.org
Sat Mar 28 23:50:24 GMT 2020


cochise added inline comments.

INLINE COMMENTS

> dfaure wrote in file_unix.cpp:184
> You're doing two copies here. From `offset` to `key.data()`, and then from `key.data()` -- the return value of qstrcpy -- into the QByteArray key (which calls the QByteArray(const char*) constructor).
> 
> This can be simplified.
> Option 1: just remove the assignment, just do the qstrcpy. But it still smells like C to me. And there's a security bug if keyLen is ever too small.
> Option 2: QByteArray key(offset); So simple. No need for strlen before, no need for qstrcpy, it all happens internally in that constructor.

So many time looking for a way to get a copy until a null, and it's in one of the constructors.
This looks a lot better.

REPOSITORY
  R241 KIO

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

To: cochise, dfaure, chinmoyr, bruns, #frameworks, tmarshall, usta
Cc: usta, scheirle, anthonyfieroni, tmarshall, arrowd, cfeck, bruns, phidrho, dhaumann, funkybomber, abika, pino, davidedmundson, ngraham, atha.kane, spoorun, nicolasfella, kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200328/87fc25cc/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list