From ac7ee21331c903ab24856850a5003c4f79ae5d42 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Wed, 18 Mar 2020 19:05:23 -0300 Subject: 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. --- src/core/hle/service/time/time_zone_content_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/hle/service/time/time_zone_content_manager.cpp b/src/core/hle/service/time/time_zone_content_manager.cpp index 57b1a2bca..78d4acd95 100644 --- a/src/core/hle/service/time/time_zone_content_manager.cpp +++ b/src/core/hle/service/time/time_zone_content_manager.cpp @@ -53,7 +53,7 @@ static std::vector BuildLocationNameCache(Core::System& system) { return {}; } - std::vector raw_data(binary_list->GetSize()); + std::vector raw_data(binary_list->GetSize() + 1); binary_list->ReadBytes(raw_data.data(), binary_list->GetSize()); std::stringstream data_stream{raw_data.data()}; -- cgit v1.2.3