Skip to content

Commit 8636dc8

Browse files
COM Host - Invalid compute of default value string length (dotnet#45728)
Incorrectly compute the length of the default string value for a registry key. This doesn't impact the actual COM registration but does impact tooling that helps with COM registration.
1 parent 68fffd6 commit 8636dc8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/installer/corehost/cli/comhost/comhost.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ namespace
269269
0,
270270
REG_SZ,
271271
reinterpret_cast<const BYTE*>(entry.type.c_str()),
272-
static_cast<DWORD>(sizeof(entry.type.size() + 1) * sizeof(entry.type[0])));
272+
static_cast<DWORD>((entry.type.size() + 1) * sizeof(entry.type[0])));
273273
if (res != ERROR_SUCCESS)
274274
return __HRESULT_FROM_WIN32(res);
275275

@@ -346,7 +346,7 @@ namespace
346346
0,
347347
REG_SZ,
348348
reinterpret_cast<const BYTE*>(defServerName),
349-
static_cast<DWORD>(sizeof(defServerName) * sizeof(defServerName[0])));
349+
static_cast<DWORD>(sizeof(defServerName)));
350350
if (res != ERROR_SUCCESS)
351351
return __HRESULT_FROM_WIN32(res);
352352

0 commit comments

Comments
 (0)