Commit 3b6b2107 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

shell32: Fix a buffer overflow in CommandLineToArgvW().

parent 1262f076
...@@ -227,15 +227,20 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs) ...@@ -227,15 +227,20 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
if (*s) if (*s)
s++; s++;
} }
/* close the argument */ /* close the executable path */
*d++=0; *d++=0;
/* skip to the first argument and initialize it if any */ /* skip to the first argument and initialize it if any */
while (*s==' ' || *s=='\t') while (*s==' ' || *s=='\t')
s++; s++;
if (*s) if (!*s)
argv[argc++]=d; {
/* There are no parameters so we are all done */
*numargs=argc;
return argv;
}
/* Split and copy the remaining arguments */ /* Split and copy the remaining arguments */
argv[argc++]=d;
qcount=bcount=0; qcount=bcount=0;
while (*s) while (*s)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment