From 26adc0c6bf1e4aafe6dc261f8aca09636ca63912 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 19 Feb 2023 21:38:21 -0600 Subject: Fix double-free bugs in thmutil. Fixes 7231 --- src/libs/dutil/WixToolset.DUtil/thmutil.cpp | 6 ++--- .../theme/BafThmUtilTestingTheme.xml | 27 ++++++++++++++++++++++ .../theme/BafThmUtilTestingThemeLoose.xml | 27 ++++++++++++++++++++++ 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp index 7bd98a1a..7938cd0b 100644 --- a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp @@ -3752,7 +3752,7 @@ static HRESULT ParseActions( ++i; ReleaseNullBSTR(bstrType); - ReleaseObject(pixnChild); + ReleaseNullObject(pixnChild); } } @@ -3984,8 +3984,8 @@ static HRESULT ParseRadioButtons( pControl->fLastRadioButton = TRUE; } - ReleaseObject(pixnl); - ReleaseObject(pixnRadioButtons); + ReleaseNullObject(pixnl); + ReleaseNullObject(pixnRadioButtons); } LExit: diff --git a/src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingTheme.xml b/src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingTheme.xml index c890d7df..a5198a13 100644 --- a/src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingTheme.xml +++ b/src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingTheme.xml @@ -160,6 +160,33 @@ There are currently four states for a button: default, focus, hover, and selecte Back + + + + + + + + + + + + One + Two + + + + + + + + + + + + + + One + Two + +