diff options
| author | Bob Arnson <bob@firegiant.com> | 2023-05-01 21:09:14 -0400 |
|---|---|---|
| committer | Bob Arnson <github@bobs.org> | 2023-05-01 22:11:50 -0400 |
| commit | 8016c4dd39fe1f8816c968952a2aac5a98c09560 (patch) | |
| tree | ce846909a300a9c2810c1019622b51cb2818a758 /src | |
| parent | ab8d368fe8e7a41e503ec295b196035922293ef4 (diff) | |
| download | wix-8016c4dd39fe1f8816c968952a2aac5a98c09560.tar.gz wix-8016c4dd39fe1f8816c968952a2aac5a98c09560.tar.bz2 wix-8016c4dd39fe1f8816c968952a2aac5a98c09560.zip | |
Tame some wild pointers.
Maybe Rust wouldn't be so bad...
Fixes https://github.com/wixtoolset/issues/issues/7451.
Diffstat (limited to 'src')
| -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)" /> |
