summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-12-26 16:20:54 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-12-26 16:25:05 +0100
commit6431fe8ead64eb0c89fa395483e45e7ce70c26e2 (patch)
tree300bbca612753f3d6b343fb44ece0c10163b9468
parentec424f311aabfd34df1833878503236505e51656 (diff)
downloadcurl-bagder/operate-first_arg-null.tar.gz
tool_operate: avoid NULL dereference of first_argbagder/operate-first_arg-null
Follow-up to 6a5e020d4d2b04a Identified by OSS-Fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28999
-rw-r--r--src/tool_operate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 9e80ca2e5..97fc2859e 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -2542,7 +2542,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 */