1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 23:04:59 +00:00

GFileSystemModel: Don't copy the null-terminator after readlink()

This commit is contained in:
Andreas Kling 2020-01-28 10:51:48 +01:00
parent 8131875da6
commit e7512ae2d1

View file

@ -75,7 +75,8 @@ bool GFileSystemModel::Node::fetch_data(const String& full_path, bool is_root)
if (length < 0) {
perror("readlink");
} else {
symlink_target = String(buffer, length);
ASSERT(length > 0);
symlink_target = String(buffer, length - 1);
}
}