From 7c3f4c94a4ed5c3921ce02a4f099b3a6b99ab35c Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 28 Jun 2015 19:06:07 +0000 Subject: [PATCH] [USETUP] Restrict valid characters of the install path to: - Letters - Digits - Dots (.) - Backslashes (\) - Dashes (-) - Underscores (_) CORE-6179 #resolve svn path=/trunk/; revision=68307 --- reactos/base/setup/usetup/interface/usetup.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index 17f680d0aa9..c5261c5bc75 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -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); + } } } }