src/tool_doswin.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tool_doswin.c b/src/tool_doswin.c index 70b263113..28489a521 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -739,6 +739,8 @@ bool tool_isVistaOrGreater; CURLcode win32_init(void) { + size_t acmdln_len, wcmdln_len; + /* curlx_verify_windows_version must be called during init at least once because it has its own initialization routine. */ if(curlx_verify_windows_version(6, 0, 0, PLATFORM_WINNT, @@ -753,6 +755,12 @@ CURLcode win32_init(void) init_terminal(); #endif + SecureZeroMemory(_acmdln, acmdln_len = strlen(_acmdln) * sizeof(char)); + SecureZeroMemory(_wcmdln, wcmdln_len = wcslen(_wcmdln) * sizeof(wchar_t)); + + if (acmdln_len >= 4) strcpy(_acmdln, "curl"); + if (wcmdln_len >= 4) wcscpy(_wcmdln, L"curl"); + return CURLE_OK; }