@joebigelow / wix / commits / 86cb96db

Disallow attributes in Billboard/Panel.

Fixes https://github.com/wixtoolset/issues/issues/6893.

Bob Arnson committed Sep 15, 2022 at 15:48 UTC 86cb96db39f97aacf1ed78b1e95fefe15e54bee6
1 file changed +14
src/libs/dutil/WixToolset.DUtil/thmutil.cpp
+14
@@ -3777,6 +3777,7 @@ static HRESULT ParseBillboardPanels(
3777 HRESULT hr = S_OK;
3778 IXMLDOMNodeList* pixnl = NULL;
3779 IXMLDOMNode* pixnChild = NULL;
3780 + IXMLDOMNamedNodeMap* pixnnmAttributes = NULL;
3781 DWORD dwValue = 0;
3782 THEME_CONTROL* pControl = NULL;
3783
@@ -3796,6 +3797,17 @@ static HRESULT ParseBillboardPanels(
3797
3798 while (S_OK == (hr = XmlNextElement(pixnl, &pixnChild, NULL)))
3799 {
3800 + hr = pixnChild->get_attributes(&pixnnmAttributes);
3801 + ThmExitOnFailure(hr, "Failed to get attributes for billboard panel.");
3802 +
3803 + hr = pixnnmAttributes->get_length(reinterpret_cast<long*>(&dwValue));
3804 + ThmExitOnFailure(hr, "Failed to count attributes for billboard panel.");
3805 +
3806 + if (dwValue)
3807 + {
3808 + ThmExitWithRootFailure(hr, E_INVALIDDATA, "Billboard panels cannot contain attributes.");
3809 + }
3810 +
3811 pControl = pParentControl->rgControls + pParentControl->cControls;
3812 pParentControl->cControls += 1;
3813 pControl->type = THEME_CONTROL_TYPE_PANEL;
@@ -3809,11 +3821,13 @@ static HRESULT ParseBillboardPanels(
3821 hr = ParseControls(hModule, wzRelativePath, pixnChild, pTheme, pControl, pPage, PANEL_CHILD_CONTROL_NAMES);
3822 ThmExitOnFailure(hr, "Failed to parse control.");
3823
3824 + ReleaseNullObject(pixnnmAttributes);
3825 ReleaseNullObject(pixnChild);
3826 }
3827
3828 LExit:
3829 ReleaseObject(pixnl);
3830 + ReleaseObject(pixnnmAttributes);
3831 ReleaseObject(pixnChild);
3832
3833 return hr;