|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68732 Unchecked return value
Submitted: 2015-01-03 03:51 UTC Modified: 2017-10-24 06:20 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: bugreports at internot dot info Assigned:
Status: Open Package: OpenSSL related
PHP Version: master-Git-2015-01-03 (Git) OS: Linux Ubuntu 14.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-01-03 03:51 UTC] bugreports at internot dot info

In /ext/openssl/xp_ssl.c:

1682                                        php_pollfd_for(sslsock->s.socket, (err == SSL_ERROR_WANT_READ) ?
1683                                                (POLLIN|POLLPRI) : POLLOUT, has_timeout ? &left_time : NULL);

But this result is never checked.

Everywhere else php_pollfd_for is used, the return result is checked. And it should be here too.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-04 17:15 UTC]
In this case the return value from php_pollfd_for has no bearing on the remainder of the operation. It simply tells us whether or not there is readable data available on the the underlying socket descriptor. This isn't really a bug ... but yes ... we can make the code more efficient by checking the return value and avoiding another trip around the loop (I'm looking at the current master branch -- not the version from 2015-01-03).

Thanks for the report. I'll clean this up sooner rather than later and report back.
 [2015-03-04 17:18 UTC]
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: rdlowrey
 [2017-10-24 05:15 UTC]
-Status: Analyzed +Status: Assigned
 [2017-10-24 06:20 UTC]
-Status: Assigned +Status: Open -Assigned To: rdlowrey +Assigned To:
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 31 09:03:39 2023 UTC