From 06cb4ffa648f813c347ca0e807af07f05eaa216c Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Fri, 10 Mar 2023 16:53:31 -0800 Subject: [PATCH] winupdater: fix CR getting into parsed VCToolsUpdateURL --- Source/Core/WinUpdater/Platform.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/WinUpdater/Platform.cpp b/Source/Core/WinUpdater/Platform.cpp index 0a2b62c5f9..bc8ccb843e 100644 --- a/Source/Core/WinUpdater/Platform.cpp +++ b/Source/Core/WinUpdater/Platform.cpp @@ -103,7 +103,10 @@ private: auto key_it = map.find(key); if (key_it == map.end()) continue; - key_it->second = line.substr(equals_index + 1); + auto val_start = equals_index + 1; + auto eol = line.find('\r', val_start); + auto val_size = (eol == line.npos) ? line.npos : eol - val_start; + key_it->second = line.substr(val_start, val_size); } } Map map;