Skip to content
Commit 44512b6a authored by Taro Yamada's avatar Taro Yamada Committed by Andreas Hartmetz
Browse files

Sanitize the symlink name buffer size.

Currently, KIO uses lstat to get the buffersize for readlink.
But in certain situations, it returns an inappropriate value.

For example, "/proc/self" or "/sys/bus/cpu/devices/*" returns
its size is 0, and then readlink fails with EINVAL (so the
link won't be shown in KDE applications). TMSU seems to return
the target's actual filesize instead of the link size,
i.e. the length of the target's filename.

This patch limits the initial buffer size to sane values and
expands the buffer when needed. The behavior is similar to
ls, so it should be compatible with all filesystems.

REVIEW: 129259
BUG: 369275
parent 50872009
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment