Commit 33d62f3f authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

wininet: Handle NULL req->netconn in INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT query.

parent dd35601b
......@@ -2125,6 +2125,9 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe
case INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT: {
PCCERT_CONTEXT context;
if(!req->netconn)
return ERROR_INTERNET_INVALID_OPERATION;
if(*size < sizeof(INTERNET_CERTIFICATE_INFOA)) {
*size = sizeof(INTERNET_CERTIFICATE_INFOA);
return ERROR_INSUFFICIENT_BUFFER;
......
......@@ -3354,6 +3354,13 @@ static void test_options(int port)
ret = InternetQueryOption(req, INTERNET_OPTION_DIAGNOSTIC_SOCKET_INFO, &idsi, &size);
ok(ret, "InternetQueryOption failed %u\n", GetLastError());
size = 0;
SetLastError(0xdeadbeef);
ret = InternetQueryOption(req, INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT, NULL, &size);
error = GetLastError();
ok(!ret, "InternetQueryOption succeeded\n");
ok(error == ERROR_INTERNET_INVALID_OPERATION, "expected ERROR_INTERNET_INVALID_OPERATION, got %u\n", error);
/* INTERNET_OPTION_PROXY */
SetLastError(0xdeadbeef);
ret = InternetQueryOptionA(ses, INTERNET_OPTION_PROXY, NULL, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment