diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-04-28 16:36:56 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-04-29 13:58:14 -0500 |
commit | bcd3ee7ab858d62beb36af9f5986544b68a3dd35 (patch) | |
tree | 424c4e61a580b7c4b7481712f69ab0193d76b9c4 /src/dutil/metautil.cpp | |
parent | d73c29407fe5ec6a0207af7d9c2547457ae0854c (diff) | |
download | wix-bcd3ee7ab858d62beb36af9f5986544b68a3dd35.tar.gz wix-bcd3ee7ab858d62beb36af9f5986544b68a3dd35.tar.bz2 wix-bcd3ee7ab858d62beb36af9f5986544b68a3dd35.zip |
Clean up more 32-bit assumptions.
Diffstat (limited to 'src/dutil/metautil.cpp')
-rw-r--r-- | src/dutil/metautil.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dutil/metautil.cpp b/src/dutil/metautil.cpp index 109cd31e..f313fc1c 100644 --- a/src/dutil/metautil.cpp +++ b/src/dutil/metautil.cpp | |||
@@ -299,7 +299,14 @@ extern "C" HRESULT DAPI MetaGetValue( | |||
299 | MetaExitOnNull(pmr->pbMDData, hr, E_OUTOFMEMORY, "failed to allocate memory for metabase value"); | 299 | MetaExitOnNull(pmr->pbMDData, hr, E_OUTOFMEMORY, "failed to allocate memory for metabase value"); |
300 | } | 300 | } |
301 | else // set the size of the data to the actual size of the memory | 301 | else // set the size of the data to the actual size of the memory |
302 | pmr->dwMDDataLen = (DWORD)MemSize(pmr->pbMDData); | 302 | { |
303 | SIZE_T cb = MemSize(pmr->pbMDData); | ||
304 | if (cb > DWORD_MAX) | ||
305 | { | ||
306 | MetaExitOnRootFailure(hr = E_INVALIDSTATE, "metabase data is too large: %Iu", cb); | ||
307 | } | ||
308 | pmr->dwMDDataLen = (DWORD)cb; | ||
309 | } | ||
303 | 310 | ||
304 | hr = piMetabase->GetData(mhKey, wzKey, pmr, &cbRequired); | 311 | hr = piMetabase->GetData(mhKey, wzKey, pmr, &cbRequired); |
305 | if (HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) == hr) | 312 | if (HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) == hr) |