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