Author: ekohl Date: Sun Jun 28 19:06:07 2015 New Revision: 68307
URL: http://svn.reactos.org/svn/reactos?rev=68307&view=rev Log: [USETUP] Restrict valid characters of the install path to: - Letters - Digits - Dots (.) - Backslashes () - Dashes (-) - Underscores (_)
CORE-6179 #resolve
Modified: trunk/reactos/base/setup/usetup/interface/usetup.c
Modified: trunk/reactos/base/setup/usetup/interface/usetup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interface... ============================================================================== --- trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] Sun Jun 28 19:06:07 2015 @@ -3080,6 +3080,7 @@ PDISKENTRY DiskEntry; PPARTENTRY PartEntry; WCHAR InstallDir[51]; + WCHAR c; ULONG Length;
/* We do not need the filsystem list any more */ @@ -3157,10 +3158,14 @@ { 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); + } } } }