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/reswutil.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/reswutil.cpp')
-rw-r--r-- | src/dutil/reswutil.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dutil/reswutil.cpp b/src/dutil/reswutil.cpp index 42b49c55..e78de84a 100644 --- a/src/dutil/reswutil.cpp +++ b/src/dutil/reswutil.cpp | |||
@@ -288,13 +288,16 @@ static HRESULT StringBlockChangeString( | |||
288 | { | 288 | { |
289 | HRESULT hr = S_OK; | 289 | HRESULT hr = S_OK; |
290 | LPWSTR pwzData = NULL; | 290 | LPWSTR pwzData = NULL; |
291 | DWORD cchData = lstrlenW(szData); | 291 | size_t cchData = 0; |
292 | |||
293 | hr = ::StringCchLengthW(szData, STRSAFE_MAX_LENGTH, &cchData); | ||
294 | ReswExitOnRootFailure(hr, "Failed to get block string length."); | ||
292 | 295 | ||
293 | pwzData = static_cast<LPWSTR>(MemAlloc((cchData + 1) * sizeof(WCHAR), TRUE)); | 296 | pwzData = static_cast<LPWSTR>(MemAlloc((cchData + 1) * sizeof(WCHAR), TRUE)); |
294 | ReswExitOnNull(pwzData, hr, E_OUTOFMEMORY, "Failed to allocate new block string."); | 297 | ReswExitOnNull(pwzData, hr, E_OUTOFMEMORY, "Failed to allocate new block string."); |
295 | 298 | ||
296 | hr = ::StringCchCopyW(pwzData, cchData + 1, szData); | 299 | hr = ::StringCchCopyW(pwzData, cchData + 1, szData); |
297 | ReswExitOnFailure(hr, "Failed to copy new block string."); | 300 | ReswExitOnRootFailure(hr, "Failed to copy new block string."); |
298 | 301 | ||
299 | ReleaseNullMem(pStrBlock->rgwz[dwStringId]); | 302 | ReleaseNullMem(pStrBlock->rgwz[dwStringId]); |
300 | 303 | ||