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~6^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9ae8a0e5da751e2abfcb00a621056c3a15ed009f;p=GitHub%2FWoltLab%2FWCF.git Explicitly handle `fgets()` returning `false` in SmtpEmailTransport (cherry picked from commit a6ed0b255968e9ef44c6e37f7eb71fa4ad5256ea) --- 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 1cfe0d39e2..e64735c6a9 100644 --- a/wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php +++ b/wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php @@ -218,6 +218,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."); }