D13898: Use non deprecated fastInsert in file.cpp (first of many to come)
Jaime Torres Amate
noreply at phabricator.kde.org
Fri Jul 6 07:39:30 BST 2018
jtamate added inline comments.
INLINE COMMENTS
> bruns wrote in file.cpp:864
> This is broken (although not new).
>
> `buff.st_size` is the size of the target name **without** null byte.
> readlink(..., .., bufferSize) thus will typically read exactly bufferSize bytes, thus n == bufferSize
> As a result, the 'good' case in the branches below will not pass, and a resize(bufferSize *= 2) and another readlink will happen.
According to the man page (2+3), readlink() //does not append a null byte to buf//.
It will (silently) truncate the contents (to a length of bufsiz characters), in case the buffer is too small to hold all of the contents.
REPOSITORY
R241 KIO
REVISION DETAIL
https://phabricator.kde.org/D13898
To: jtamate, dfaure, #frameworks
Cc: bruns, kde-frameworks-devel, michaelh, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180706/2f0d8ece/attachment.html>
More information about the Kde-frameworks-devel
mailing list