From 796a20134cdec2a408b8256dc307f55d2c75aa7d Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 22 May 2020 16:46:39 +1000 Subject: WIXBUG:3813 For "All Unassigned" set the binding to '*'. --- src/ca/scaweb7.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/ca') diff --git a/src/ca/scaweb7.cpp b/src/ca/scaweb7.cpp index e1893782..3ee781f2 100644 --- a/src/ca/scaweb7.cpp +++ b/src/ca/scaweb7.cpp @@ -828,16 +828,16 @@ static HRESULT ScaWebWrite7( } // set the IP address appropriately - if (0 == wcscmp(psw->swaBinding.wzIP, L"*")) + if (0 == wcscmp(psw->swaBinding.wzIP, L"")) { - ::ZeroMemory(wzIP, sizeof(wzIP)); + hr = ::StringCchCopyW(wzIP, countof(wzIP), L"*"); // if no IP specified = add * } else { #pragma prefast(suppress:26037, "Source string is null terminated - it is populated as target of ::StringCchCopyW") - hr = ::StringCchCopyW(wzIP, countof(wzIP), psw->swaBinding.wzIP); - ExitOnFailure(hr, "Failed to copy IP string"); + hr = ::StringCchCopyW(wzIP, countof(wzIP), psw->swaBinding.wzIP); // else leave untouched } + ExitOnFailure(hr, "Failed to copy IP string"); hr = ::StringCchPrintfW(wzBinding, countof(wzBinding), L"%s:%d:%s", wzIP, psw->swaBinding.iPort, psw->swaBinding.wzHeader); ExitOnFailure(hr, "Failed to format IP:Port:Header binding string"); @@ -849,16 +849,17 @@ static HRESULT ScaWebWrite7( for (ui = 0; (ui < MAX_ADDRESSES_PER_WEB) && (ui < psw->cExtraAddresses); ++ui) { // set the IP address appropriately - if (0 == wcscmp(psw->swaExtraAddresses[ui].wzIP, L"*")) + if (0 == wcscmp(psw->swaExtraAddresses[ui].wzIP, L"")) { - ::ZeroMemory(wzIP, sizeof(wzIP)); + hr = ::StringCchCopyW(wzIP, countof(wzIP), L"*"); // if no IP specified = add * } else { #pragma prefast(suppress:26037, "Source string is null terminated - it is populated as target of ::StringCchCopyW") - hr = ::StringCchCopyW(wzIP, countof(wzIP), psw->swaExtraAddresses[ui].wzIP); - ExitOnFailure(hr, "Failed to copy web IP"); + hr = ::StringCchCopyW(wzIP, countof(wzIP), psw->swaExtraAddresses[ui].wzIP); //else leave untouched } + ExitOnFailure(hr, "Failed to copy web IP string"); + hr = ::StringCchPrintfW(wzBinding, countof(wzBinding), L"%s:%d:%s", wzIP, psw->swaExtraAddresses[ui].iPort, psw->swaExtraAddresses[ui].wzHeader); ExitOnFailure(hr, "Failed to copy web IP"); -- cgit v1.2.3-55-g6feb