From de8ebd42135145369c4461f90ee4cceb84efc50d Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 28 Aug 2022 18:11:49 -0500 Subject: [PATCH] Fix crash in thmviewer. --- src/libs/dutil/thmutil.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libs/dutil/thmutil.cpp b/src/libs/dutil/thmutil.cpp index e56af9d4d..6679769bc 100644 --- a/src/libs/dutil/thmutil.cpp +++ b/src/libs/dutil/thmutil.cpp @@ -356,9 +356,6 @@ DAPI_(HRESULT) ThemeLoadFromResource( hr = ResReadData(hModule, szResource, &pvResource, &cbResource); ExitOnFailure(hr, "Failed to read theme from resource."); - // Ensure returned resource buffer is null-terminated. - reinterpret_cast(pvResource)[cbResource - 1] = '\0'; - hr = StrAllocStringAnsi(&sczXml, reinterpret_cast(pvResource), cbResource, CP_UTF8); ExitOnFailure(hr, "Failed to convert XML document data from UTF-8 to unicode string.");