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
Please register or sign in to comment