diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-03-30 17:05:56 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-04-01 22:06:11 -0500 |
commit | ae3a31795614000207470e6824887c414366a681 (patch) | |
tree | 7c3c659ee5efdbc7b4c7c93108221b229c26fd2d /src/burn/engine/netfxchainer.cpp | |
parent | e7a208587389a17fa5ff3654d533e023268bfddf (diff) | |
download | wix-ae3a31795614000207470e6824887c414366a681.tar.gz wix-ae3a31795614000207470e6824887c414366a681.tar.bz2 wix-ae3a31795614000207470e6824887c414366a681.zip |
Minimize chance of user arguments messing up the command line
to avoid variations of issue 3890
Diffstat (limited to 'src/burn/engine/netfxchainer.cpp')
-rw-r--r-- | src/burn/engine/netfxchainer.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/burn/engine/netfxchainer.cpp b/src/burn/engine/netfxchainer.cpp index af4f03f5..6f223eed 100644 --- a/src/burn/engine/netfxchainer.cpp +++ b/src/burn/engine/netfxchainer.cpp | |||
@@ -329,8 +329,9 @@ LExit: | |||
329 | } | 329 | } |
330 | 330 | ||
331 | extern "C" HRESULT NetFxRunChainer( | 331 | extern "C" HRESULT NetFxRunChainer( |
332 | __in LPCWSTR wzExecutablePath, | 332 | __in_z LPCWSTR wzExecutablePath, |
333 | __in LPCWSTR wzArguments, | 333 | __in_z LPWSTR sczBaseCommand, |
334 | __in_z_opt LPCWSTR wzUserArgs, | ||
334 | __in PFN_GENERICMESSAGEHANDLER pfnGenericMessageHandler, | 335 | __in PFN_GENERICMESSAGEHANDLER pfnGenericMessageHandler, |
335 | __in LPVOID pvContext, | 336 | __in LPVOID pvContext, |
336 | __out DWORD* pdwExitCode | 337 | __out DWORD* pdwExitCode |
@@ -360,8 +361,15 @@ extern "C" HRESULT NetFxRunChainer( | |||
360 | hr = CreateNetFxChainer(sczSectionName, sczEventName, &pNetfxChainer); | 361 | hr = CreateNetFxChainer(sczSectionName, sczEventName, &pNetfxChainer); |
361 | ExitOnFailure(hr, "Failed to create netfx chainer."); | 362 | ExitOnFailure(hr, "Failed to create netfx chainer."); |
362 | 363 | ||
363 | hr = StrAllocFormattedSecure(&sczCommand, L"%ls /pipe %ls", wzArguments, sczSectionName); | 364 | hr = StrAllocFormatted(&sczCommand, L"%ls /pipe %ls", sczBaseCommand, sczSectionName); |
364 | ExitOnFailure(hr, "Failed to allocate netfx chainer arguments."); | 365 | ExitOnFailure(hr, "Failed to append netfx chainer args."); |
366 | |||
367 | // Always add user supplied arguments last. | ||
368 | if (wzUserArgs) | ||
369 | { | ||
370 | hr = StrAllocConcatFormattedSecure(&sczCommand, L" %ls", wzUserArgs); | ||
371 | ExitOnFailure(hr, "Failed to append user args."); | ||
372 | } | ||
365 | 373 | ||
366 | si.cb = sizeof(si); | 374 | si.cb = sizeof(si); |
367 | if (!::CreateProcessW(wzExecutablePath, sczCommand, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi)) | 375 | if (!::CreateProcessW(wzExecutablePath, sczCommand, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi)) |