From 1446d4e582465af5c09db3fba16afc59529a3863 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 11 May 2021 17:14:30 -0500 Subject: Fix StrAllocString assertions. --- src/burn/engine/registration.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/burn/engine') diff --git a/src/burn/engine/registration.cpp b/src/burn/engine/registration.cpp index 19da543c..5b246112 100644 --- a/src/burn/engine/registration.cpp +++ b/src/burn/engine/registration.cpp @@ -1137,14 +1137,15 @@ static HRESULT GetBundleManufacturer( ) { HRESULT hr = S_OK; + LPCWSTR wzPublisher = pRegistration->sczPublisher ? pRegistration->sczPublisher : L""; hr = VariableGetString(pVariables, BURN_BUNDLE_MANUFACTURER, psczBundleManufacturer); if (E_NOTFOUND == hr) { - hr = VariableSetString(pVariables, BURN_BUNDLE_MANUFACTURER, pRegistration->sczPublisher, FALSE, FALSE); + hr = VariableSetString(pVariables, BURN_BUNDLE_MANUFACTURER, wzPublisher, FALSE, FALSE); ExitOnFailure(hr, "Failed to set bundle manufacturer."); - hr = StrAllocString(psczBundleManufacturer, pRegistration->sczPublisher, 0); + hr = StrAllocString(psczBundleManufacturer, wzPublisher, 0); } ExitOnFailure(hr, "Failed to get bundle manufacturer."); @@ -1159,14 +1160,15 @@ static HRESULT GetBundleName( ) { HRESULT hr = S_OK; + LPCWSTR wzDisplayName = pRegistration->sczDisplayName ? pRegistration->sczDisplayName : L""; hr = VariableGetString(pVariables, BURN_BUNDLE_NAME, psczBundleName); if (E_NOTFOUND == hr) { - hr = VariableSetString(pVariables, BURN_BUNDLE_NAME, pRegistration->sczDisplayName, FALSE, FALSE); + hr = VariableSetString(pVariables, BURN_BUNDLE_NAME, wzDisplayName, FALSE, FALSE); ExitOnFailure(hr, "Failed to set bundle name."); - hr = StrAllocString(psczBundleName, pRegistration->sczDisplayName, 0); + hr = StrAllocString(psczBundleName, wzDisplayName, 0); } ExitOnFailure(hr, "Failed to get bundle name."); -- cgit v1.2.3-55-g6feb