diff options
author | Bob Arnson <bob@firegiant.com> | 2023-05-01 21:09:14 -0400 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2023-06-03 01:24:39 -0700 |
commit | 5520259549e1ca3380c8e03d5660e399ed12c48e (patch) | |
tree | 0b6058493f5e4666a678489d790e0b308a95fb88 | |
parent | 1d7ca4c4d7edfb16be7ca24ca680c9b630d56e7c (diff) | |
download | wix-5520259549e1ca3380c8e03d5660e399ed12c48e.tar.gz wix-5520259549e1ca3380c8e03d5660e399ed12c48e.tar.bz2 wix-5520259549e1ca3380c8e03d5660e399ed12c48e.zip |
Tame some wild pointers.
Maybe Rust wouldn't be so bad...
Fixes https://github.com/wixtoolset/issues/issues/7451.
-rw-r--r-- | src/burn/engine/bundlepackageengine.cpp | 8 | ||||
-rw-r--r-- | src/test/burn/TestData/DependencyTests/BundleF/BundleF.wxs | 13 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/burn/engine/bundlepackageengine.cpp b/src/burn/engine/bundlepackageengine.cpp index 95f5acbc..61911fb4 100644 --- a/src/burn/engine/bundlepackageengine.cpp +++ b/src/burn/engine/bundlepackageengine.cpp | |||
@@ -151,7 +151,7 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes( | |||
151 | hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczDetectCodes), *pcDetectCodes, 1, sizeof(LPWSTR), 5); | 151 | hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczDetectCodes), *pcDetectCodes, 1, sizeof(LPWSTR), 5); |
152 | ExitOnFailure(hr, "Failed to resize Detect code array"); | 152 | ExitOnFailure(hr, "Failed to resize Detect code array"); |
153 | 153 | ||
154 | *prgsczDetectCodes[*pcDetectCodes] = sczId; | 154 | (*prgsczDetectCodes)[*pcDetectCodes] = sczId; |
155 | sczId = NULL; | 155 | sczId = NULL; |
156 | *pcDetectCodes += 1; | 156 | *pcDetectCodes += 1; |
157 | } | 157 | } |
@@ -160,7 +160,7 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes( | |||
160 | hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczUpgradeCodes), *pcUpgradeCodes, 1, sizeof(LPWSTR), 5); | 160 | hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczUpgradeCodes), *pcUpgradeCodes, 1, sizeof(LPWSTR), 5); |
161 | ExitOnFailure(hr, "Failed to resize Upgrade code array"); | 161 | ExitOnFailure(hr, "Failed to resize Upgrade code array"); |
162 | 162 | ||
163 | *prgsczUpgradeCodes[*pcUpgradeCodes] = sczId; | 163 | (*prgsczUpgradeCodes)[*pcUpgradeCodes] = sczId; |
164 | sczId = NULL; | 164 | sczId = NULL; |
165 | *pcUpgradeCodes += 1; | 165 | *pcUpgradeCodes += 1; |
166 | } | 166 | } |
@@ -169,7 +169,7 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes( | |||
169 | hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczAddonCodes), *pcAddonCodes, 1, sizeof(LPWSTR), 5); | 169 | hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczAddonCodes), *pcAddonCodes, 1, sizeof(LPWSTR), 5); |
170 | ExitOnFailure(hr, "Failed to resize Addon code array"); | 170 | ExitOnFailure(hr, "Failed to resize Addon code array"); |
171 | 171 | ||
172 | *prgsczAddonCodes[*pcAddonCodes] = sczId; | 172 | (*prgsczAddonCodes)[*pcAddonCodes] = sczId; |
173 | sczId = NULL; | 173 | sczId = NULL; |
174 | *pcAddonCodes += 1; | 174 | *pcAddonCodes += 1; |
175 | } | 175 | } |
@@ -178,7 +178,7 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes( | |||
178 | hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczPatchCodes), *pcPatchCodes, 1, sizeof(LPWSTR), 5); | 178 | hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczPatchCodes), *pcPatchCodes, 1, sizeof(LPWSTR), 5); |
179 | ExitOnFailure(hr, "Failed to resize Patch code array"); | 179 | ExitOnFailure(hr, "Failed to resize Patch code array"); |
180 | 180 | ||
181 | *prgsczPatchCodes[*pcPatchCodes] = sczId; | 181 | (*prgsczPatchCodes)[*pcPatchCodes] = sczId; |
182 | sczId = NULL; | 182 | sczId = NULL; |
183 | *pcPatchCodes += 1; | 183 | *pcPatchCodes += 1; |
184 | } | 184 | } |
diff --git a/src/test/burn/TestData/DependencyTests/BundleF/BundleF.wxs b/src/test/burn/TestData/DependencyTests/BundleF/BundleF.wxs index 4fb1fd43..cfeda6c4 100644 --- a/src/test/burn/TestData/DependencyTests/BundleF/BundleF.wxs +++ b/src/test/burn/TestData/DependencyTests/BundleF/BundleF.wxs | |||
@@ -3,7 +3,18 @@ | |||
3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:fortestinguseonly="http://wixtoolset.org/schemas/v4/wxs/fortestinguseonly"> | 3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:fortestinguseonly="http://wixtoolset.org/schemas/v4/wxs/fortestinguseonly"> |
4 | <Fragment> | 4 | <Fragment> |
5 | <fortestinguseonly:ForTestingUseOnlyBundle Id="{5E9D5B04-41EA-4196-954C-1F7357C31FB0}" /> | 5 | <fortestinguseonly:ForTestingUseOnlyBundle Id="{5E9D5B04-41EA-4196-954C-1F7357C31FB0}" /> |
6 | <RelatedBundle Id="583B5ECB-04E6-4837-A30C-A1ADCBE24235" Action="detect" /> | 6 | <RelatedBundle Id="{AAAAAAAA-0000-0000-0000-000000000000}" Action="addon" /> |
7 | <RelatedBundle Id="{BBBBBBBB-0000-0000-0000-000000000000}" Action="patch" /> | ||
8 | <RelatedBundle Id="{CCCCCCCC-0000-0000-0000-000000000000}" Action="upgrade" /> | ||
9 | <RelatedBundle Id="{DDDDDDDD-0000-0000-0000-000000000000}" Action="detect" /> | ||
10 | <RelatedBundle Id="{AAAAAAAA-1111-0000-0000-000000000000}" Action="addon" /> | ||
11 | <RelatedBundle Id="{BBBBBBBB-1111-0000-0000-000000000000}" Action="patch" /> | ||
12 | <RelatedBundle Id="{CCCCCCCC-1111-0000-0000-000000000000}" Action="upgrade" /> | ||
13 | <RelatedBundle Id="{DDDDDDDD-1111-0000-0000-000000000000}" Action="detect" /> | ||
14 | <RelatedBundle Id="{AAAAAAAA-2222-0000-0000-000000000000}" Action="addon" /> | ||
15 | <RelatedBundle Id="{BBBBBBBB-2222-0000-0000-000000000000}" Action="patch" /> | ||
16 | <RelatedBundle Id="{CCCCCCCC-2222-0000-0000-000000000000}" Action="upgrade" /> | ||
17 | <RelatedBundle Id="{DDDDDDDD-2222-0000-0000-000000000000}" Action="detect" /> | ||
7 | 18 | ||
8 | <PackageGroup Id="BundlePackages"> | 19 | <PackageGroup Id="BundlePackages"> |
9 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" /> | 20 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" /> |