WIXBUG:3813 For "All Unassigned" set the binding to '*'.
Sean Hall committed
May 22, 2020 at 16:46 UTC
796a20134cdec2a408b8256dc307f55d2c75aa7d
1 file changed
+9
-8
src/ca/scaweb7.cpp
+9
-8
@@ -828,16 +828,16 @@ static HRESULT ScaWebWrite7(
828
}
829
830
// set the IP address appropriately
831
- if (0 == wcscmp(psw->swaBinding.wzIP, L"*"))
831
+ if (0 == wcscmp(psw->swaBinding.wzIP, L""))
832
{
833
- ::ZeroMemory(wzIP, sizeof(wzIP));
833
+ hr = ::StringCchCopyW(wzIP, countof(wzIP), L"*"); // if no IP specified = add *
834
}
835
else
836
{
837
#pragma prefast(suppress:26037, "Source string is null terminated - it is populated as target of ::StringCchCopyW")
838
- hr = ::StringCchCopyW(wzIP, countof(wzIP), psw->swaBinding.wzIP);
839
- ExitOnFailure(hr, "Failed to copy IP string");
838
+ hr = ::StringCchCopyW(wzIP, countof(wzIP), psw->swaBinding.wzIP); // else leave untouched
839
}
840
+ ExitOnFailure(hr, "Failed to copy IP string");
841
842
hr = ::StringCchPrintfW(wzBinding, countof(wzBinding), L"%s:%d:%s", wzIP, psw->swaBinding.iPort, psw->swaBinding.wzHeader);
843
ExitOnFailure(hr, "Failed to format IP:Port:Header binding string");
@@ -849,16 +849,17 @@ static HRESULT ScaWebWrite7(
849
for (ui = 0; (ui < MAX_ADDRESSES_PER_WEB) && (ui < psw->cExtraAddresses); ++ui)
850
{
851
// set the IP address appropriately
852
- if (0 == wcscmp(psw->swaExtraAddresses[ui].wzIP, L"*"))
852
+ if (0 == wcscmp(psw->swaExtraAddresses[ui].wzIP, L""))
853
{
854
- ::ZeroMemory(wzIP, sizeof(wzIP));
854
+ hr = ::StringCchCopyW(wzIP, countof(wzIP), L"*"); // if no IP specified = add *
855
}
856
else
857
{
858
#pragma prefast(suppress:26037, "Source string is null terminated - it is populated as target of ::StringCchCopyW")
859
- hr = ::StringCchCopyW(wzIP, countof(wzIP), psw->swaExtraAddresses[ui].wzIP);
860
- ExitOnFailure(hr, "Failed to copy web IP");
859
+ hr = ::StringCchCopyW(wzIP, countof(wzIP), psw->swaExtraAddresses[ui].wzIP); //else leave untouched
860
}
861
+ ExitOnFailure(hr, "Failed to copy web IP string");
862
+
863
hr = ::StringCchPrintfW(wzBinding, countof(wzBinding), L"%s:%d:%s", wzIP, psw->swaExtraAddresses[ui].iPort, psw->swaExtraAddresses[ui].wzHeader);
864
ExitOnFailure(hr, "Failed to copy web IP");
865