From f620790e1ce9ab83ed7ed782cef999aaa8a1092e Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Sat, 13 Dec 2025 21:38:14 +0100 Subject: [PATCH] Don't tolerate complex strings in the wine registry --- components/files/wineutils.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/files/wineutils.hpp b/components/files/wineutils.hpp index 73edbafd6b..b6aed24bd0 100644 --- a/components/files/wineutils.hpp +++ b/components/files/wineutils.hpp @@ -49,11 +49,13 @@ namespace Files::Wine } it = mwpath.erase(it); if (it == mwpath.end()) - break; + return {}; // Invalid string char& c = *it; + // Replace \ with / if (c == '\\') c = '/'; - // In theory we should probably handle \r, \n, \0, etc. + else // And just give up on any non-\ value + return {}; ++it; } // Change drive letter to lowercase, so we could use ~/.wine/dosdevices symlinks