diff options
Diffstat (limited to 'core/modules/run-virt/winres/src/winres.c')
-rw-r--r-- | core/modules/run-virt/winres/src/winres.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/modules/run-virt/winres/src/winres.c b/core/modules/run-virt/winres/src/winres.c index a9e6024a..fe93d45d 100644 --- a/core/modules/run-virt/winres/src/winres.c +++ b/core/modules/run-virt/winres/src/winres.c @@ -227,7 +227,7 @@ static void CALLBACK launchRunscript(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWO { static int fails = 0; wchar_t params[BUFLEN] = L""; - wchar_t emptyParams[1] = L""; + wchar_t emptyParams[BUFLEN] = L""; wchar_t nuser[BUFLEN] = L""; wchar_t npass[BUFLEN] = L""; @@ -247,14 +247,20 @@ static void CALLBACK launchRunscript(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWO alog("Could not convert user/password to unicode"); goto failure; } - wchar_t *end = params + BUFLEN; + // Build command line with user password + wchar_t *end = params + BUFLEN - 2; wchar_t *ptr = params; ptr = escapeShellArg(nuser, ptr, end); *ptr++ = ' '; ptr = escapeShellArg(npass, ptr, end); *ptr = '\0'; + // Build command line without password, just user + end = emptyParams + BUFLEN - 2; + ptr = emptyParams; + escapeShellArg(nuser, ptr, end); + *ptr = '\0'; if (_debug) { - wlog(L"Params are '%s'", params); + wlog(L"Params are '%s'", emptyParams); } // Scan folder |