Fix invalid C code (undefined behavior).
This commit is contained in:
parent
e6ebf42c2b
commit
8aceb00c52
|
@ -628,9 +628,11 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
|
||||||
SetUrlComponentValue(&lpUrlComponents->lpszUserName,
|
SetUrlComponentValue(&lpUrlComponents->lpszUserName,
|
||||||
&lpUrlComponents->dwUserNameLength, lpszUser, lpszPasswd - lpszUser);
|
&lpUrlComponents->dwUserNameLength, lpszUser, lpszPasswd - lpszUser);
|
||||||
|
|
||||||
|
if (lpszPasswd != lpszHost)
|
||||||
|
lpszPasswd++;
|
||||||
SetUrlComponentValue(&lpUrlComponents->lpszPassword,
|
SetUrlComponentValue(&lpUrlComponents->lpszPassword,
|
||||||
&lpUrlComponents->dwPasswordLength,
|
&lpUrlComponents->dwPasswordLength,
|
||||||
lpszPasswd == lpszHost ? NULL : ++lpszPasswd,
|
lpszPasswd == lpszHost ? NULL : lpszPasswd,
|
||||||
lpszHost - lpszPasswd);
|
lpszHost - lpszPasswd);
|
||||||
|
|
||||||
lpszcp++; /* Advance to beginning of host */
|
lpszcp++; /* Advance to beginning of host */
|
||||||
|
|
Loading…
Reference in New Issue