[*] Prevent overflow into UNC root namespace of hostnames and volumes via path or filename overflow

This commit is contained in:
Reece Wilson 2023-09-12 00:52:16 +01:00
parent 92593be412
commit 6062a16d9c

View File

@ -184,7 +184,8 @@ namespace Aurora::IO::FS
#if defined(AURORA_IS_MODERNNT_DERIVED) #if defined(AURORA_IS_MODERNNT_DERIVED)
if (result.size() >= MAX_PATH) if (result.size() >= MAX_PATH)
{ {
if (!AuStartsWith(result, "\\\\")) if (!AuStartsWith(result, "\\\\") &&
result[1] == ':')
{ {
result = "\\\\?\\" + result; result = "\\\\?\\" + result;
} }