From b9d465c89f9feac4848137ba3587b1c1f0bb886c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 5 Aug 2024 08:39:08 +0200 Subject: [PATCH] tool_help: fix a NULL deref in the --help option code Follow-up to 9a0cf56471c1a Pointed out by CodeSonar Closes #14391 --- src/tool_help.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tool_help.c b/src/tool_help.c index f7ecb72199..b4dce29904 100644 --- a/src/tool_help.c +++ b/src/tool_help.c @@ -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; -- 2.47.3