mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 03:27:15 +02:00
GFileSystemModel: Don't copy the null-terminator after readlink()
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 09:46:00 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e7512ae2d18
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user