bruns added inline comments.

INLINE COMMENTS

> file.cpp:864
>              while (true) {
>                  ssize_t n = readlink(path.constData(), 
> linkTargetBuffer.data(), bufferSize);
>                  if (n < 0 && errno != ERANGE) {

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.

REPOSITORY
  R241 KIO

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

To: jtamate, dfaure, #frameworks
Cc: bruns, kde-frameworks-devel, michaelh, ngraham

Reply via email to