From: Tim Düsterhus Date: Fri, 9 Sep 2022 08:16:02 +0000 (+0200) Subject: Explicitly handle `fgets()` returning `false` in SmtpEmailTransport X-Git-Tag: 5.5.5_dev_1~21 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a6ed0b255968e9ef44c6e37f7eb71fa4ad5256ea;p=GitHub%2FWoltLab%2FWCF.git Explicitly handle `fgets()` returning `false` in SmtpEmailTransport --- diff --git a/wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php b/wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php index eb832217e8..1b38ffb66c 100644 --- a/wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php +++ b/wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php @@ -217,6 +217,9 @@ class SmtpEmailTransport implements IStatusReportingEmailTransport if ($this->connection->eof()) { throw new TransientFailure("Unexpected EOF / connection close from SMTP server."); } + if ($data === false) { + throw new TransientFailure("Failed to read from SMTP server."); + } throw new TransientFailure("Unexpected reply '" . $data . "' from SMTP server."); }