kernel32: Don't validate the command line parameter of CreateProcessW.
This commit is contained in:
parent
b0abafe70f
commit
6c27fa1038
|
@ -1787,12 +1787,6 @@ static LPWSTR get_file_name( LPCWSTR appname, LPWSTR cmdline, LPWSTR buffer,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cmdline)
|
|
||||||
{
|
|
||||||
SetLastError( ERROR_INVALID_PARAMETER );
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* first check for a quoted file name */
|
/* first check for a quoted file name */
|
||||||
|
|
||||||
if ((cmdline[0] == '"') && ((p = strchrW( cmdline + 1, '"' ))))
|
if ((cmdline[0] == '"') && ((p = strchrW( cmdline + 1, '"' ))))
|
||||||
|
|
|
@ -925,6 +925,16 @@ static void test_CommandLine(void)
|
||||||
okChildStringWA("Arguments", "CommandLineW", buffer2);
|
okChildStringWA("Arguments", "CommandLineW", buffer2);
|
||||||
release_memory();
|
release_memory();
|
||||||
assert(DeleteFileA(resfile) != 0);
|
assert(DeleteFileA(resfile) != 0);
|
||||||
|
|
||||||
|
if (0) /* Test crashes on NT-based Windows. */
|
||||||
|
{
|
||||||
|
/* Test NULL application name and command line parameters. */
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
ret = CreateProcessA(NULL, NULL, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info);
|
||||||
|
ok(!ret, "CreateProcessA unexpectedly succeeded\n");
|
||||||
|
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
||||||
|
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_Directory(void)
|
static void test_Directory(void)
|
||||||
|
|
Loading…
Reference in New Issue