Module: wine Branch: master Commit: 0b366dca3c05121204ab751ac597ccb45af262a0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0b366dca3c05121204ab751ac5...
Author: Hans Leidekker hans@codeweavers.com Date: Mon Sep 15 16:36:44 2014 +0200
winhttp: Verify the async parameter type in IWinHttpRequest::Open.
---
dlls/winhttp/request.c | 2 +- dlls/winhttp/tests/winhttp.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 1f9b4aa..d497d7a 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -2992,7 +2992,7 @@ static HRESULT WINAPI winhttp_request_Open( path[uc.dwUrlPathLength + uc.dwExtraInfoLength] = 0;
if (!(verb = strdupW( method ))) goto error; - if (V_BOOL( &async )) flags |= WINHTTP_FLAG_ASYNC; + if (V_VT( &async ) == VT_BOOL && V_BOOL( &async )) flags |= WINHTTP_FLAG_ASYNC; if (!(hsession = WinHttpOpen( user_agentW, WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, NULL, NULL, flags ))) { err = get_last_error(); diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 51fcc86..27fb212 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -2561,6 +2561,8 @@ static void test_IWinHttpRequest(void) method = SysAllocString( method1W ); SysFreeString( url ); url = SysAllocString( url1W ); + V_VT( &async ) = VT_ERROR; + V_ERROR( &async ) = DISP_E_PARAMNOTFOUND; hr = IWinHttpRequest_Open( req, method, url, async ); ok( hr == S_OK, "got %08x\n", hr );