Skip to content
Snippets Groups Projects
Commit ac7ee213 authored by ReinUsesLisp's avatar ReinUsesLisp
Browse files

time_zone_content_manager: Fix out of bounds read

There were cases where raw_data didn't contain enough
space to hold the zero terminator.

This was caught with -fsanitize=address.
parent 56ea0f8a
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,7 @@ static std::vector<std::string> BuildLocationNameCache(Core::System& system) { ...@@ -53,7 +53,7 @@ static std::vector<std::string> BuildLocationNameCache(Core::System& system) {
return {}; return {};
} }
std::vector<char> raw_data(binary_list->GetSize()); std::vector<char> raw_data(binary_list->GetSize() + 1);
binary_list->ReadBytes<char>(raw_data.data(), binary_list->GetSize()); binary_list->ReadBytes<char>(raw_data.data(), binary_list->GetSize());
std::stringstream data_stream{raw_data.data()}; std::stringstream data_stream{raw_data.data()};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment