php.net |  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
Votes:2
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
40 - 5 = ?
Subscribe to this entry?

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

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.



Thanks,


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-04 17:15 UTC] rdlowrey@php.net
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] rdlowrey@php.net
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: rdlowrey
 [2017-10-24 05:15 UTC] kalle@php.net
-Status: Analyzed +Status: Assigned
 [2017-10-24 06:20 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: rdlowrey +Assigned To:
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 16:01:31 2024 UTC