]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_help: fix a NULL deref in the --help option code
authorDaniel Stenberg <daniel@haxx.se>
Mon, 5 Aug 2024 06:39:08 +0000 (08:39 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 5 Aug 2024 13:55:38 +0000 (15:55 +0200)
Follow-up to 9a0cf56471c1a

Pointed out by CodeSonar

Closes #14391

src/tool_help.c

index f7ecb7219938a4b1d12e78ca3c0ddadf24cb3a71..b4dce29904332f5e790d85affe7d7d0257fd00b8 100644 (file)
@@ -264,7 +264,7 @@ void tool_help(char *category)
         noflagged = TRUE;
       }
       a = findlongopt(lookup);
-      if(noflagged && (ARGTYPE(a->desc) != ARG_BOOL))
+      if(a && noflagged && (ARGTYPE(a->desc) != ARG_BOOL))
         /* a --no- prefix for a non-boolean is not specifying a proper
            option */
         a = NULL;