From 613436dbbb309690e4bb09b3bc58ddfdfe7ed1e7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 7 May 2025 16:36:08 +0200 Subject: [PATCH] netrc: avoid NULL deref on weird input A dynbuf that never gets populated might return a NULL, and Coverity could find a way through like that. Closes #17275 --- lib/netrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/netrc.c b/lib/netrc.c index 5de3286385..4afd2a0846 100644 --- a/lib/netrc.c +++ b/lib/netrc.c @@ -247,7 +247,7 @@ static NETRCcode parsenetrc(struct store_netrc *store, } break; case MACDEF: - if(!*tok) + if(!tok || !*tok) state = NOTHING; break; case HOSTFOUND: -- 2.47.3