aboutsummaryrefslogtreecommitdiff
path: root/src/libs
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2022-09-15 15:48:30 -0400
committerBob Arnson <github@bobs.org>2022-09-15 16:56:14 -0400
commit86cb96db39f97aacf1ed78b1e95fefe15e54bee6 (patch)
tree5ed3893c7e4a232866463fe04e1d69ac23661cb9 /src/libs
parenta470bbc209dff298dbf86a29393d6a2a8b768dc8 (diff)
downloadwix-86cb96db39f97aacf1ed78b1e95fefe15e54bee6.tar.gz
wix-86cb96db39f97aacf1ed78b1e95fefe15e54bee6.tar.bz2
wix-86cb96db39f97aacf1ed78b1e95fefe15e54bee6.zip
Disallow attributes in Billboard/Panel.
Fixes https://github.com/wixtoolset/issues/issues/6893.
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/thmutil.cpp14
1 files changed, 14 insertions, 0 deletions
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(
3777 HRESULT hr = S_OK; 3777 HRESULT hr = S_OK;
3778 IXMLDOMNodeList* pixnl = NULL; 3778 IXMLDOMNodeList* pixnl = NULL;
3779 IXMLDOMNode* pixnChild = NULL; 3779 IXMLDOMNode* pixnChild = NULL;
3780 IXMLDOMNamedNodeMap* pixnnmAttributes = NULL;
3780 DWORD dwValue = 0; 3781 DWORD dwValue = 0;
3781 THEME_CONTROL* pControl = NULL; 3782 THEME_CONTROL* pControl = NULL;
3782 3783
@@ -3796,6 +3797,17 @@ static HRESULT ParseBillboardPanels(
3796 3797
3797 while (S_OK == (hr = XmlNextElement(pixnl, &pixnChild, NULL))) 3798 while (S_OK == (hr = XmlNextElement(pixnl, &pixnChild, NULL)))
3798 { 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
3799 pControl = pParentControl->rgControls + pParentControl->cControls; 3811 pControl = pParentControl->rgControls + pParentControl->cControls;
3800 pParentControl->cControls += 1; 3812 pParentControl->cControls += 1;
3801 pControl->type = THEME_CONTROL_TYPE_PANEL; 3813 pControl->type = THEME_CONTROL_TYPE_PANEL;
@@ -3809,11 +3821,13 @@ static HRESULT ParseBillboardPanels(
3809 hr = ParseControls(hModule, wzRelativePath, pixnChild, pTheme, pControl, pPage, PANEL_CHILD_CONTROL_NAMES); 3821 hr = ParseControls(hModule, wzRelativePath, pixnChild, pTheme, pControl, pPage, PANEL_CHILD_CONTROL_NAMES);
3810 ThmExitOnFailure(hr, "Failed to parse control."); 3822 ThmExitOnFailure(hr, "Failed to parse control.");
3811 3823
3824 ReleaseNullObject(pixnnmAttributes);
3812 ReleaseNullObject(pixnChild); 3825 ReleaseNullObject(pixnChild);
3813 } 3826 }
3814 3827
3815LExit: 3828LExit:
3816 ReleaseObject(pixnl); 3829 ReleaseObject(pixnl);
3830 ReleaseObject(pixnnmAttributes);
3817 ReleaseObject(pixnChild); 3831 ReleaseObject(pixnChild);
3818 3832
3819 return hr; 3833 return hr;