cURL-build-win32/patch/curl_tool_doswin.diff

30 lines
866 B
Diff
Raw Normal View History

src/tool_doswin.c | 8 ++++++++
1 file changed, 8 insertions(+)
2024-08-01 22:24:44 +02:00
diff --git a/src/tool_doswin.c b/src/tool_doswin.c
index 70b263113..28489a521 100644
2024-08-01 22:24:44 +02:00
--- 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();
2024-08-01 22:24:44 +02:00
#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;
}