summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Libraries/LibGUI/GFileSystemModel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Libraries/LibGUI/GFileSystemModel.cpp b/Libraries/LibGUI/GFileSystemModel.cpp
index 1f1bc35cc4..c0ed10eb8c 100644
--- a/Libraries/LibGUI/GFileSystemModel.cpp
+++ b/Libraries/LibGUI/GFileSystemModel.cpp
@@ -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);
}
}