From 6062a16d9c73cc3a639e16f202aadcf831b46753 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Tue, 12 Sep 2023 00:52:16 +0100 Subject: [PATCH] [*] Prevent overflow into UNC root namespace of hostnames and volumes via path or filename overflow --- Source/IO/FS/FS.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/IO/FS/FS.cpp b/Source/IO/FS/FS.cpp index e26b9430..e1a8d57d 100644 --- a/Source/IO/FS/FS.cpp +++ b/Source/IO/FS/FS.cpp @@ -184,7 +184,8 @@ namespace Aurora::IO::FS #if defined(AURORA_IS_MODERNNT_DERIVED) if (result.size() >= MAX_PATH) { - if (!AuStartsWith(result, "\\\\")) + if (!AuStartsWith(result, "\\\\") && + result[1] == ':') { result = "\\\\?\\" + result; }