1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

tool_operate: avoid NULL dereference of first_arg

Follow-up to 6a5e020d4d
Identified by OSS-Fuzz
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28999
Closes #6377
This commit is contained in:
Daniel Stenberg 2020-12-26 16:20:54 +01:00
parent 8ab78f720a
commit e6c5613ea8
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -2539,7 +2539,7 @@ CURLcode operate(struct GlobalConfig *global, int argc, argv_item_t argv[])
/* Parse .curlrc if necessary */
if((argc == 1) ||
(strncmp(first_arg, "-q", 2) &&
(first_arg && strncmp(first_arg, "-q", 2) &&
!curl_strequal(first_arg, "--disable"))) {
parseconfig(NULL, global); /* ignore possible failure */