From a6ed0b255968e9ef44c6e37f7eb71fa4ad5256ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 9 Sep 2022 10:16:02 +0200 Subject: [PATCH] Explicitly handle `fgets()` returning `false` in SmtpEmailTransport --- .../lib/system/email/transport/SmtpEmailTransport.class.php | 3 +++ 1 file changed, 3 insertions(+) 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."); } -- 2.20.1