Skip to content

Commit 538491b

Browse files
committed
bug symfony#48075 [Mailer] Stream timeout not detected fgets returns false (Sezil)
This PR was submitted for the 5.4 branch but it was merged into the 4.4 branch instead. Discussion ---------- [Mailer] Stream timeout not detected fgets returns false symfony#48074 [Mailer] Stream timeout not detected due to checking only string result of function fgets | Q | A | ------------- | --- | Branch? | 6.2 for features / 4.4, 5.4, 6.0 or 6.1 for bug fixes <!-- see below --> | Bug fix? | yes/no | New feature? | yes/no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Commits ------- 486f2c5 [Mailer] Stream timeout not detected due to checking only string result of function fgets
2 parents e1641da + 486f2c5 commit 538491b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Mailer/Transport/Smtp/Stream/AbstractStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function readLine(): string
7575
}
7676

7777
$line = fgets($this->out);
78-
if ('' === $line) {
78+
if ('' === $line || false === $line) {
7979
$metas = stream_get_meta_data($this->out);
8080
if ($metas['timed_out']) {
8181
throw new TransportException(sprintf('Connection to "%s" timed out.', $this->getReadConnectionDescription()));

0 commit comments

Comments
 (0)