src/tool_doswin.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tool_doswin.c b/src/tool_doswin.c index 301b2974e..6720ad5d7 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -741,6 +741,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, @@ -755,6 +757,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; }