@joebigelow / wix-1 / commits / 26adc0c6

Fix double-free bugs in thmutil.

Fixes 7231

Sean Hall committed Feb 19, 2023 at 21:38 UTC 26adc0c6bf1e4aafe6dc261f8aca09636ca63912
3 files changed +57 -3
src/libs/dutil/WixToolset.DUtil/thmutil.cpp
+3 -3
@@ -3752,7 +3752,7 @@ static HRESULT ParseActions(
3752
3753 ++i;
3754 ReleaseNullBSTR(bstrType);
3755 - ReleaseObject(pixnChild);
3755 + ReleaseNullObject(pixnChild);
3756 }
3757 }
3758
@@ -3984,8 +3984,8 @@ static HRESULT ParseRadioButtons(
3984 pControl->fLastRadioButton = TRUE;
3985 }
3986
3987 - ReleaseObject(pixnl);
3988 - ReleaseObject(pixnRadioButtons);
3987 + ReleaseNullObject(pixnl);
3988 + ReleaseNullObject(pixnRadioButtons);
3989 }
3990
3991 LExit:
src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingTheme.xml
+27
@@ -160,6 +160,33 @@ There are currently four states for a button: default, focus, hover, and selecte
160 <Text>Back</Text>
161 <ChangePageAction Page="Progressbar" />
162 </Button>
163 + <Button Name="RadioButtonsButton" X="-183" Y="-11" Width="75" Height="23" TabStop="yes" FontId="Default">
164 + <Text>Next</Text>
165 + <ChangePageAction Page="RadioButtons" />
166 + </Button>
167 + </Page>
168 + <Page Name="RadioButtons">
169 + <Label X="6" Y="6" Width="-6" Height="43" FontId="Default">
170 + This page has two groups of radio buttons. Only one value should be able to be selected for each group. A value should be able to be selected for both groups.
171 + </Label>
172 + <Label X="6" Y="50" Width="-6" Height="13" FontId="Default">
173 + Choice #1:
174 + </Label>
175 + <RadioButtons Name="CHOICE">
176 + <RadioButton Height="30" Width="30" X="33" Y="68" Value="1" />
177 + <RadioButton Height="30" Width="30" X="33" Y="103" Value="2" />
178 + </RadioButtons>
179 + <Label X="6" Y="138" Width="-6" Height="13" FontId="Default">
180 + Choice #2:
181 + </Label>
182 + <RadioButtons Name="CHOICE2">
183 + <RadioButton Height="30" Width="130" X="33" Y="156" Value="1">One</RadioButton>
184 + <RadioButton Height="30" Width="130" X="33" Y="191" Value="2">Two</RadioButton>
185 + </RadioButtons>
186 + <Button Name="RadioButtonsBackButton" X="-269" Y="-11" Width="75" Height="23" TabStop="yes" FontId="Default">
187 + <Text>Back</Text>
188 + <ChangePageAction Page="Billboard" />
189 + </Button>
190 </Page>
191 <Button Name="StartButton" X="-97" Y="-11" Width="75" Height="23" TabStop="yes" FontId="Default" Visible="yes">
192 <Text>Start</Text>
src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingThemeLoose.xml
+27
@@ -160,6 +160,33 @@ There are currently four states for a button: default, focus, hover, and selecte
160 <Text>Back</Text>
161 <ChangePageAction Page="Progressbar" />
162 </Button>
163 + <Button Name="RadioButtonsButton" X="-183" Y="-11" Width="75" Height="23" TabStop="yes" FontId="Default">
164 + <Text>Next</Text>
165 + <ChangePageAction Page="RadioButtons" />
166 + </Button>
167 + </Page>
168 + <Page Name="RadioButtons">
169 + <Label X="6" Y="6" Width="-6" Height="43" FontId="Default">
170 + This page has two groups of radio buttons. Only one value should be able to be selected for each group. A value should be able to be selected for both groups.
171 + </Label>
172 + <Label X="6" Y="50" Width="-6" Height="13" FontId="Default">
173 + Choice #1:
174 + </Label>
175 + <RadioButtons Name="CHOICE">
176 + <RadioButton Height="30" Width="30" X="33" Y="68" Value="1" />
177 + <RadioButton Height="30" Width="30" X="33" Y="103" Value="2" />
178 + </RadioButtons>
179 + <Label X="6" Y="138" Width="-6" Height="13" FontId="Default">
180 + Choice #2:
181 + </Label>
182 + <RadioButtons Name="CHOICE2">
183 + <RadioButton Height="30" Width="130" X="33" Y="156" Value="1">One</RadioButton>
184 + <RadioButton Height="30" Width="130" X="33" Y="191" Value="2">Two</RadioButton>
185 + </RadioButtons>
186 + <Button Name="RadioButtonsBackButton" X="-269" Y="-11" Width="75" Height="23" TabStop="yes" FontId="Default">
187 + <Text>Back</Text>
188 + <ChangePageAction Page="Billboard" />
189 + </Button>
190 </Page>
191 <Button Name="StartButton" X="-97" Y="-11" Width="75" Height="23" TabStop="yes" FontId="Default" Visible="yes">
192 <Text>Start</Text>