From: Daniel Stenberg Date: Wed, 7 May 2025 14:36:08 +0000 (+0200) Subject: netrc: avoid NULL deref on weird input X-Git-Tag: curl-8_14_0~142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=613436dbbb309690e4bb09b3bc58ddfdfe7ed1e7;p=thirdparty%2Fcurl.git 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 --- 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: