Restrict valid characters of the install path to:
- Letters
- Digits
- Dots (.)
- Backslashes (\)
- Dashes (-)
- Underscores (_)

CORE-6179 #resolve

svn path=/trunk/; revision=68307
This commit is contained in:
Eric Kohl 2015-06-28 19:06:07 +00:00
parent 0bc85fb9f3
commit 7c3f4c94a4

View file

@ -3080,6 +3080,7 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
PDISKENTRY DiskEntry;
PPARTENTRY PartEntry;
WCHAR InstallDir[51];
WCHAR c;
ULONG Length;
/* We do not need the filsystem list any more */
@ -3157,10 +3158,14 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
{
if (Length < 50)
{
InstallDir[Length] = (WCHAR)Ir->Event.KeyEvent.uChar.AsciiChar;
Length++;
InstallDir[Length] = 0;
CONSOLE_SetInputTextXY(8, 11, 51, InstallDir);
c = (WCHAR)Ir->Event.KeyEvent.uChar.AsciiChar;
if (iswalpha(c) || iswdigit(c) || c == '.' || c == '\\' || c == '-' || c == '_')
{
InstallDir[Length] = c;
Length++;
InstallDir[Length] = 0;
CONSOLE_SetInputTextXY(8, 11, 51, InstallDir);
}
}
}
}