From 86cb96db39f97aacf1ed78b1e95fefe15e54bee6 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 15 Sep 2022 15:48:30 -0400 Subject: Disallow attributes in Billboard/Panel. Fixes https://github.com/wixtoolset/issues/issues/6893. --- src/libs/dutil/WixToolset.DUtil/thmutil.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/libs') diff --git a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp index 05f7c098..cab5e89c 100644 --- a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp @@ -3777,6 +3777,7 @@ static HRESULT ParseBillboardPanels( HRESULT hr = S_OK; IXMLDOMNodeList* pixnl = NULL; IXMLDOMNode* pixnChild = NULL; + IXMLDOMNamedNodeMap* pixnnmAttributes = NULL; DWORD dwValue = 0; THEME_CONTROL* pControl = NULL; @@ -3796,6 +3797,17 @@ static HRESULT ParseBillboardPanels( while (S_OK == (hr = XmlNextElement(pixnl, &pixnChild, NULL))) { + hr = pixnChild->get_attributes(&pixnnmAttributes); + ThmExitOnFailure(hr, "Failed to get attributes for billboard panel."); + + hr = pixnnmAttributes->get_length(reinterpret_cast(&dwValue)); + ThmExitOnFailure(hr, "Failed to count attributes for billboard panel."); + + if (dwValue) + { + ThmExitWithRootFailure(hr, E_INVALIDDATA, "Billboard panels cannot contain attributes."); + } + pControl = pParentControl->rgControls + pParentControl->cControls; pParentControl->cControls += 1; pControl->type = THEME_CONTROL_TYPE_PANEL; @@ -3809,11 +3821,13 @@ static HRESULT ParseBillboardPanels( hr = ParseControls(hModule, wzRelativePath, pixnChild, pTheme, pControl, pPage, PANEL_CHILD_CONTROL_NAMES); ThmExitOnFailure(hr, "Failed to parse control."); + ReleaseNullObject(pixnnmAttributes); ReleaseNullObject(pixnChild); } LExit: ReleaseObject(pixnl); + ReleaseObject(pixnnmAttributes); ReleaseObject(pixnChild); return hr; -- cgit v1.2.3-55-g6feb