diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 5e303aeb473..51db944115e 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -1097,14 +1097,17 @@ static void ConvertUrlComponentValue(LPSTR* lppszComponent, LPDWORD dwComponentL LPWSTR lpwszComponent, DWORD dwwComponentLen, LPCSTR lpszStart, LPCWSTR lpwszStart) { - TRACE("%p %p %p %ld %p %p\n", lppszComponent, dwComponentLen, lpwszComponent, dwwComponentLen, lpszStart, lpwszStart); + TRACE("%p %ld %p %ld %p %p\n", lppszComponent, *dwComponentLen, lpwszComponent, dwwComponentLen, lpszStart, lpwszStart); if (*dwComponentLen != 0) { DWORD nASCIILength=WideCharToMultiByte(CP_ACP,0,lpwszComponent,dwwComponentLen,NULL,0,NULL,NULL); if (*lppszComponent == NULL) { int nASCIIOffset=WideCharToMultiByte(CP_ACP,0,lpwszStart,lpwszComponent-lpwszStart,NULL,0,NULL,NULL); - *lppszComponent = (LPSTR)lpszStart+nASCIIOffset; + if (lpwszComponent) + *lppszComponent = (LPSTR)lpszStart+nASCIIOffset; + else + *lppszComponent = NULL; *dwComponentLen = nASCIILength; } else diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 9c7e213b5aa..093fb7430bb 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -610,11 +610,9 @@ static void InternetCrackUrl_test(void) ok(!strncmp(urlComponents.lpszHostName,TEST_URL_HOST,strlen(TEST_URL_HOST)),"lpszHostName should be %s but is %s\n", TEST_URL_HOST, urlComponents.lpszHostName); ok(urlComponents.nPort == INTERNET_DEFAULT_HTTP_PORT,"urlComponents->nPort should have been 80 instead of %d\n", urlComponents.nPort); ok(urlComponents.nScheme == INTERNET_SCHEME_HTTP,"urlComponents->nScheme should have been INTERNET_SCHEME_HTTP instead of %d\n", urlComponents.nScheme); - todo_wine { ok(!urlComponents.lpszUserName, ".lpszUserName should have been set to NULL\n"); ok(!urlComponents.lpszPassword, ".lpszPassword should have been set to NULL\n"); ok(!urlComponents.lpszExtraInfo, ".lpszExtraInfo should have been set to NULL\n"); - } ok(!urlComponents.dwUserNameLength,".dwUserNameLength should be 0, but is %ld\n", urlComponents.dwUserNameLength); ok(!urlComponents.dwPasswordLength,".dwPasswordLength should be 0, but is %ld\n", urlComponents.dwPasswordLength); ok(!urlComponents.dwExtraInfoLength,".dwExtraInfoLength should be 0, but is %ld\n", urlComponents.dwExtraInfoLength);