Fixed a crash when browsing dirs with malformed symlinks

Authored by nmel on Mar 2 2018, 7:04 AM.

Description

Fixed a crash when browsing dirs with malformed symlinks

Two major changes for improved stability:

  • check the status of lstat and show a "broken" file entry
  • use new readLinkSafely function which does not consider stat_p.st_size

but gradually increases buffer until the link destination path fits into
the buffer - this helps in case st_size contains garbage
(some network fs don't care about setting the right size)

As a complementary bonus, the change fixes the following warning:
filesystem.cpp:239:35: warning: variable length array ‘buffer’ is used

FIXED: [ 389413 ] Krusader crashes when entering directories with read errors
BUG: 389413
CCBUG: 390994

Differential Revision: https://phabricator.kde.org/D10761

Details

Committed
nmelMar 2 2018, 7:04 AM
Differential Revision
D10761: Fixed a crash when browsing dirs with malformed symlinks
Parents
R167:ce6372fe25ee: In the INSTALL file: add an additional check
Branches
Unknown
Tags
Unknown