]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
pop3: add null pointer check
authorDaniel Stenberg <daniel@haxx.se>
Tue, 6 May 2025 09:05:30 +0000 (11:05 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 6 May 2025 15:11:25 +0000 (17:11 +0200)
Pointed out by Coverity. A precaution to catch internal errors.

Follow-up to 76d13c721bcd992e3e19f52

Closes #17255

lib/pop3.c

index 5dac0f95578dfb266fe53db3fc520560cfd69207..28ed7af04f3ca779fe061e4ce9f008fbe1e229c9 100644 (file)
@@ -311,6 +311,9 @@ static bool pop3_endofresp(struct Curl_easy *data, struct connectdata *conn,
 {
   struct pop3_conn *pop3c = Curl_conn_meta_get(conn, CURL_META_POP3_CONN);
   (void)data;
+  DEBUGASSERT(pop3c);
+  if(!pop3c) /* internal error */
+    return TRUE;
 
   /* Do we have an error response? */
   if(len >= 4 && !memcmp("-ERR", line, 4)) {