Skip to content

Fix feof hanging on TLS streams (bug #77390) #3729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

kelunik
Copy link
Member

@kelunik kelunik commented Dec 31, 2018

Fixes https://bugs.php.net/bug.php?id=77390.

If n == 0 on SSL_ERROR_SYSCALL, the stream is broken, e.g. because the remote hung up. Removed the infinite loop in case of SSL_ERROR_WANT_{READ,WRITE} in case the remote doesn't send any more data. As the SSL_ERROR_SYSCALL shows if the socket is closed, it's alive in case of SSL_ERROR_WANT_{READ,WRITE}.

@kelunik
Copy link
Member Author

kelunik commented Jan 1, 2019

@bukka Maybe you want to review.

@kelunik kelunik changed the base branch from master to PHP-7.1 January 2, 2019 09:18
@kelunik kelunik changed the base branch from PHP-7.1 to PHP-7.2 January 2, 2019 09:19
@kelunik
Copy link
Member Author

kelunik commented Jan 2, 2019

@sgolemon @dshafik Should probably also be backported to PHP 7.1, as it's a possible DoS vector.

@bukka
Copy link
Member

bukka commented Jan 2, 2019

This seems to be addressed by #3223, right? I would prefer that one as it also has got a test. It just needs a bit more testing, checking and possibly a little changes in the test to integrate proxy to the existing server-client class. I will try to find some time in the next few weeks. Should have much more time in a week or two hopefully!

@kelunik
Copy link
Member Author

kelunik commented Jan 2, 2019

That's basically the same patch, yes, totally forgot about that one.

@kelunik kelunik closed this Jan 2, 2019
@kelunik kelunik deleted the bug-77390 branch January 2, 2019 17:27
annda added a commit to annda/dokuwiki that referenced this pull request Apr 14, 2021
feof() sometimes hangs if nothing has beeen written yet
see php/php-src#3729
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy