Commit 031e1ae4 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

urlmon: Check pointer before use.

parent 3bacdaf6
......@@ -294,7 +294,7 @@ static void create_file(void)
static void test_URLOpenBlockingStreamW(void)
{
HRESULT hr;
IStream *pStream;
IStream *pStream = NULL;
char buffer[256];
hr = URLOpenBlockingStreamW(NULL, NULL, &pStream, 0, &BindStatusCallback);
......@@ -324,12 +324,14 @@ static void test_URLOpenBlockingStreamW(void)
CHECK_CALLED(OnStopBinding);
ok(pStream != NULL, "pStream is NULL\n");
if(pStream)
{
hr = IStream_Read(pStream, buffer, sizeof(buffer), NULL);
ok(hr == S_OK, "IStream_Read failed with error 0x%08x\n", hr);
ok(!memcmp(buffer, szHtmlDoc, sizeof(szHtmlDoc)-1), "read data differs from file\n");
hr = IStream_Read(pStream, buffer, sizeof(buffer), NULL);
ok(hr == S_OK, "IStream_Read failed with error 0x%08x\n", hr);
ok(!memcmp(buffer, szHtmlDoc, sizeof(szHtmlDoc)-1), "read data differs from file\n");
IStream_Release(pStream);
IStream_Release(pStream);
}
}
static void test_URLOpenStreamW(void)
......
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