From 765e5f6725e1c41a6fe620cea5e52442fa0aa8f5 Mon Sep 17 00:00:00 2001 From: Jefferson Carpenter Date: Sun, 13 Jun 2021 06:20:19 +0000 Subject: [PATCH] msxml3: Null check url in parseURL. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51267 Signed-off-by: Jefferson Carpenter --- dlls/msxml3/saxreader.c | 2 ++ dlls/msxml3/tests/saxreader.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index fc27260cc2c..8c939391109 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -2745,6 +2745,8 @@ static HRESULT internal_parseURL( TRACE("(%p)->(%s)\n", This, debugstr_w(url)); + if (!url) return E_INVALIDARG; + hr = create_moniker_from_url(url, &mon); if(FAILED(hr)) return hr; diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index e401aafc87d..b1a827110e9 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -2310,6 +2310,13 @@ static void test_saxreader(void) WriteFile(file, testXML, sizeof(testXML)-1, &written, NULL); CloseHandle(file); + /* crashes on new versions */ + if (IsEqualGUID(table->clsid, &CLSID_SAXXMLReader) || + IsEqualGUID(table->clsid, &CLSID_SAXXMLReader30)) { + hr = ISAXXMLReader_parseURL(reader, NULL); + EXPECT_HR(hr, E_INVALIDARG); + } + if (IsEqualGUID(table->clsid, &CLSID_SAXXMLReader40) || IsEqualGUID(table->clsid, &CLSID_SAXXMLReader60)) test_seq = content_handler_test1_alternate; -- 2.26.2