cmd.exe: Prevent options to pushd.

This commit is contained in:
Jason Edmeades 2007-03-08 00:44:46 +00:00 committed by Alexandre Julliard
parent e5a26bc24d
commit 91aa8a0a8d
1 changed files with 6 additions and 0 deletions

View File

@ -604,6 +604,12 @@ void WCMD_pushd (char *command) {
struct env_stack *curdir; struct env_stack *curdir;
WCHAR *thisdir; WCHAR *thisdir;
if (strchr(command, '/') != NULL) {
SetLastError(ERROR_INVALID_PARAMETER);
WCMD_print_error();
return;
}
curdir = LocalAlloc (LMEM_FIXED, sizeof (struct env_stack)); curdir = LocalAlloc (LMEM_FIXED, sizeof (struct env_stack));
thisdir = LocalAlloc (LMEM_FIXED, 1024 * sizeof(WCHAR)); thisdir = LocalAlloc (LMEM_FIXED, 1024 * sizeof(WCHAR));
if( !curdir || !thisdir ) { if( !curdir || !thisdir ) {