msxml3/saxreader: Handle null url in parseURL().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51267 Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7d43ac9474
commit
b7386cec71
|
@ -2728,23 +2728,23 @@ static HRESULT internal_onDataAvailable(void *obj, char *ptr, DWORD len)
|
|||
return internal_parseBuffer(This, ptr, len, FALSE);
|
||||
}
|
||||
|
||||
static HRESULT internal_parseURL(
|
||||
saxreader* This,
|
||||
const WCHAR *url,
|
||||
BOOL vbInterface)
|
||||
static HRESULT internal_parseURL(saxreader *reader, const WCHAR *url, BOOL vbInterface)
|
||||
{
|
||||
IMoniker *mon;
|
||||
bsc_t *bsc;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_w(url));
|
||||
TRACE("%p, %s.\n", reader, debugstr_w(url));
|
||||
|
||||
if (!url && reader->version < MSXML4)
|
||||
return E_INVALIDARG;
|
||||
|
||||
hr = create_moniker_from_url(url, &mon);
|
||||
if(FAILED(hr))
|
||||
return hr;
|
||||
|
||||
if(vbInterface) hr = bind_url(mon, internal_vbonDataAvailable, This, &bsc);
|
||||
else hr = bind_url(mon, internal_onDataAvailable, This, &bsc);
|
||||
if(vbInterface) hr = bind_url(mon, internal_vbonDataAvailable, reader, &bsc);
|
||||
else hr = bind_url(mon, internal_onDataAvailable, reader, &bsc);
|
||||
IMoniker_Release(mon);
|
||||
|
||||
if(FAILED(hr))
|
||||
|
|
|
@ -2325,6 +2325,22 @@ static void test_saxreader(void)
|
|||
WriteFile(file, testXML, sizeof(testXML)-1, &written, NULL);
|
||||
CloseHandle(file);
|
||||
|
||||
/* crashes on newer versions */
|
||||
if (IsEqualGUID(table->clsid, &CLSID_SAXXMLReader) ||
|
||||
IsEqualGUID(table->clsid, &CLSID_SAXXMLReader30))
|
||||
{
|
||||
IVBSAXXMLReader *vb_reader;
|
||||
|
||||
hr = ISAXXMLReader_parseURL(reader, NULL);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = ISAXXMLReader_QueryInterface(reader, &IID_IVBSAXXMLReader, (void **)&vb_reader);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
hr = IVBSAXXMLReader_parseURL(vb_reader, NULL);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
IVBSAXXMLReader_Release(vb_reader);
|
||||
}
|
||||
|
||||
if (IsEqualGUID(table->clsid, &CLSID_SAXXMLReader40) ||
|
||||
IsEqualGUID(table->clsid, &CLSID_SAXXMLReader60))
|
||||
test_seq = content_handler_test1_alternate;
|
||||
|
|
Loading…
Reference in New Issue