]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
prevent a crash in case of broken connection
authorBaptiste Daroussin <bapt@FreeBSD.org>
Thu, 26 Mar 2026 21:32:59 +0000 (22:32 +0100)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Thu, 26 Mar 2026 21:32:59 +0000 (22:32 +0100)
src/checkwait_smtpreply.c

index a6fd692be0309bb15a28e1e90ebfb211a2f57187..82b31878ea1112c6c30b7e02daca10fd91f7729f 100644 (file)
@@ -40,7 +40,8 @@ char *checkwait_smtpreply(int sockfd, int replytype)
                do {
                        free(smtpreply);
                        smtpreply = mygetline(sockfd);
-               } while (strncmp(smtpreply, "250-", 4) == 0);
+               } while (smtpreply != NULL &&
+                   strncmp(smtpreply, "250-", 4) == 0);
        } else {
                smtpreply = mygetline(sockfd);
        }