kernel: Don't crash on NULL arg in GetShortPathNameW.

This commit is contained in:
Mike Hearn 2006-04-06 21:46:33 +01:00 committed by Alexandre Julliard
parent 1740fe0fe6
commit ddd0e03e91

View File

@ -431,7 +431,6 @@ DWORD WINAPI GetShortPathNameW( LPCWSTR longpath, LPWSTR shortpath, DWORD shortl
LPCWSTR p; LPCWSTR p;
DWORD sp = 0, lp = 0; DWORD sp = 0, lp = 0;
DWORD tmplen; DWORD tmplen;
BOOL unixabsolute = (longpath[0] == '/');
WIN32_FIND_DATAW wfd; WIN32_FIND_DATAW wfd;
HANDLE goit; HANDLE goit;
UNICODE_STRING ustr; UNICODE_STRING ustr;
@ -451,7 +450,7 @@ DWORD WINAPI GetShortPathNameW( LPCWSTR longpath, LPWSTR shortpath, DWORD shortl
} }
/* check for drive letter */ /* check for drive letter */
if (!unixabsolute && longpath[1] == ':' ) if (longpath[0] != '/' && longpath[1] == ':' )
{ {
tmpshortpath[0] = longpath[0]; tmpshortpath[0] = longpath[0];
tmpshortpath[1] = ':'; tmpshortpath[1] = ':';