wininet: Fix the case when Proxy or ProxyBypass is NULL.

This commit is contained in:
Huw Davies 2007-08-07 10:33:20 +01:00 committed by Alexandre Julliard
parent cdbd17bdb8
commit dc881a258e
1 changed files with 8 additions and 20 deletions

View File

@ -2100,25 +2100,19 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d
proxyBytesRequired);
pPI->dwAccessType = lpwai->dwAccessType;
pPI->lpszProxy = NULL;
pPI->lpszProxyBypass = NULL;
if (lpwai->lpszProxy)
{
lstrcpyW(proxy, lpwai->lpszProxy);
pPI->lpszProxy = proxy;
}
else
{
*proxy = 0;
}
pPI->lpszProxy = proxy;
if (lpwai->lpszProxyBypass)
{
lstrcpyW(proxy_bypass, lpwai->lpszProxyBypass);
pPI->lpszProxyBypass = proxy_bypass;
}
else
{
*proxy_bypass = 0;
}
pPI->lpszProxyBypass = proxy_bypass;
bSuccess = TRUE;
}
*lpdwBufferLength = sizeof(INTERNET_PROXY_INFOW) +
@ -2147,28 +2141,22 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d
proxyBytesRequired);
pPI->dwAccessType = lpwai->dwAccessType;
pPI->lpszProxy = NULL;
pPI->lpszProxyBypass = NULL;
if (lpwai->lpszProxy)
{
WideCharToMultiByte(CP_ACP, 0, lpwai->lpszProxy, -1,
proxy, proxyBytesRequired, NULL, NULL);
pPI->lpszProxy = proxy;
}
else
{
*proxy = '\0';
}
pPI->lpszProxy = proxy;
if (lpwai->lpszProxyBypass)
{
WideCharToMultiByte(CP_ACP, 0, lpwai->lpszProxyBypass,
-1, proxy_bypass, proxyBypassBytesRequired,
NULL, NULL);
pPI->lpszProxyBypass = proxy_bypass;
}
else
{
*proxy_bypass = '\0';
}
pPI->lpszProxyBypass = proxy_bypass;
bSuccess = TRUE;
}
*lpdwBufferLength = sizeof(INTERNET_PROXY_INFOA) +