diff options
Diffstat (limited to '')
| -rw-r--r-- | src/libs/dutil/WixToolset.DUtil/thmutil.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp index d3d32176..52a52a1e 100644 --- a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp | |||
| @@ -1189,6 +1189,7 @@ DAPI_(HRESULT) ThemeShowPageEx( | |||
| 1189 | BOOL fSaveEditboxes = FALSE; | 1189 | BOOL fSaveEditboxes = FALSE; |
| 1190 | THEME_SAVEDVARIABLE* pSavedVariable = NULL; | 1190 | THEME_SAVEDVARIABLE* pSavedVariable = NULL; |
| 1191 | THEME_PAGE* pPage = ThemeGetPage(pTheme, dwPage); | 1191 | THEME_PAGE* pPage = ThemeGetPage(pTheme, dwPage); |
| 1192 | SIZE_T cb = 0; | ||
| 1192 | 1193 | ||
| 1193 | if (pPage) | 1194 | if (pPage) |
| 1194 | { | 1195 | { |
| @@ -1219,9 +1220,9 @@ DAPI_(HRESULT) ThemeShowPageEx( | |||
| 1219 | if (THEME_SHOW_PAGE_REASON_REFRESH != reason) | 1220 | if (THEME_SHOW_PAGE_REASON_REFRESH != reason) |
| 1220 | { | 1221 | { |
| 1221 | pPage->cSavedVariables = 0; | 1222 | pPage->cSavedVariables = 0; |
| 1222 | if (pPage->rgSavedVariables) | 1223 | if (pPage->rgSavedVariables && SUCCEEDED(MemSizeChecked(pPage->rgSavedVariables, &cb))) |
| 1223 | { | 1224 | { |
| 1224 | SecureZeroMemory(pPage->rgSavedVariables, MemSize(pPage->rgSavedVariables)); | 1225 | SecureZeroMemory(pPage->rgSavedVariables, cb); |
| 1225 | } | 1226 | } |
| 1226 | } | 1227 | } |
| 1227 | 1228 | ||
| @@ -1238,7 +1239,11 @@ DAPI_(HRESULT) ThemeShowPageEx( | |||
| 1238 | hr = MemEnsureArraySize(reinterpret_cast<LPVOID*>(&pPage->rgSavedVariables), pPage->cControlIndices, sizeof(THEME_SAVEDVARIABLE), pPage->cControlIndices); | 1239 | hr = MemEnsureArraySize(reinterpret_cast<LPVOID*>(&pPage->rgSavedVariables), pPage->cControlIndices, sizeof(THEME_SAVEDVARIABLE), pPage->cControlIndices); |
| 1239 | ThmExitOnFailure(hr, "Failed to allocate memory for saved variables."); | 1240 | ThmExitOnFailure(hr, "Failed to allocate memory for saved variables."); |
| 1240 | 1241 | ||
| 1241 | SecureZeroMemory(pPage->rgSavedVariables, MemSize(pPage->rgSavedVariables)); | 1242 | if (SUCCEEDED(MemSizeChecked(pPage->rgSavedVariables, &cb))) |
| 1243 | { | ||
| 1244 | SecureZeroMemory(pPage->rgSavedVariables, cb); | ||
| 1245 | } | ||
| 1246 | |||
| 1242 | pPage->cSavedVariables = pPage->cControlIndices; | 1247 | pPage->cSavedVariables = pPage->cControlIndices; |
| 1243 | 1248 | ||
| 1244 | // Save the variables in the loop below. | 1249 | // Save the variables in the loop below. |
