Explicitly handle `fgets()` returning `false` in SmtpEmailTransport
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 9 Sep 2022 08:16:02 +0000 (10:16 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 9 Sep 2022 08:16:02 +0000 (10:16 +0200)
wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php

index eb832217e84c20ea9ce542f0c2d9aea6166c2d6f..1b38ffb66c6e920be3ff38d83a4775e1da9c5a7e 100644 (file)
@@ -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.");
             }