Skip to content

Commit

Permalink
GFileSystemModel: Don't copy the null-terminator after readlink()
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Jan 28, 2020
1 parent 8131875 commit e7512ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Libraries/LibGUI/GFileSystemModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit e7512ae

Please sign in to comment.