[HotFix][RegistryPreview]Fix out of bonds array access error (#28803)

This commit is contained in:
Jaime Bernardo 2023-09-27 16:35:59 +01:00 committed by GitHub
parent 1f86eefed1
commit 59fb08cdd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -445,7 +445,7 @@ namespace RegistryPreview
i++;
}
if (value[i - 1] != '\\' && value[i] == '"')
if (i < value.Length && value[i - 1] != '\\' && value[i] == '"')
{
// Don't allow non-escaped quotes
registryValue.Type = "ERROR";