mirror of
https://github.com/moparisthebest/curl
synced 2025-01-10 13:38:04 -05:00
tool_operate: check argc before accessing argv[1]
Follow-up to 09363500b
Reported-by: Emil Engler
Reviewed-by: Daniel Gustafsson
Closes #6668
This commit is contained in:
parent
8779bfe77b
commit
15bc86df33
@ -2574,7 +2574,7 @@ static CURLcode run_all_transfers(struct GlobalConfig *global,
|
|||||||
CURLcode operate(struct GlobalConfig *global, int argc, argv_item_t argv[])
|
CURLcode operate(struct GlobalConfig *global, int argc, argv_item_t argv[])
|
||||||
{
|
{
|
||||||
CURLcode result = CURLE_OK;
|
CURLcode result = CURLE_OK;
|
||||||
char *first_arg = curlx_convert_tchar_to_UTF8(argv[1]);
|
char *first_arg = argc > 1 ? curlx_convert_tchar_to_UTF8(argv[1]) : NULL;
|
||||||
|
|
||||||
/* Setup proper locale from environment */
|
/* Setup proper locale from environment */
|
||||||
#ifdef HAVE_SETLOCALE
|
#ifdef HAVE_SETLOCALE
|
||||||
|
Loading…
Reference in New Issue
Block a user