Bug #73854 [Opn->Csd]: Always true condition in php_openssl_sockop_io
| From: | laruence@php.net | Date: | Mon, 09 Jan 2017 08:31:11 +0000 |
| Subject: | Bug #73854 [Opn->Csd]: Always true condition in php_openssl_sockop_io | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206436@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73854&edit=1
ID: 73854
Updated by: laruence@php.net
Reported by: dereckson at espace-win dot org
Summary: Always true condition in php_openssl_sockop_io
-Status: Open
+Status: Closed
Type: Bug
Package: OpenSSL related
Operating System: FreeBSD
PHP Version: 7.1Git-2017-01-03 (Git)
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f7cb79431f621381722f504e75d1e71e72df6de9
Log: Fixed bug #73854 (Always true condition in php_openssl_sockop_io)
Previous Comments:
------------------------------------------------------------------------
[2017-01-03 04:23:20] dereckson at espace-win dot org
Description:
------------
Commit bbfd4a5e62c offers to "fix crypto stream timeout regressions".
It introduces the following code snippet in php_openssl_sockop_io function:
/* never use a timeout with non-blocking sockets */
if (began_blocked && &sslsock->s.timeout) {
timeout = &sslsock->s.timeout;
}
(currently in ext/openssl/xp_ssl.c around line 1910)
This condition will be always true, as this syntax means "take the address of
sslsock->s.timeout".
This is caught by clang/llvm compiler:
/home/dereckson/dev/php/php-src/ext/openssl/xp_ssl.c:1908:36: warning: address of
'sslsock->s.timeout' will always evaluate to 'true'
[-Wpointer-bool-conversion]
if (began_blocked && &sslsock->s.timeout) {
~~ ~~~~~~~~~~~^~~~~~~
1 warning generated.
Expected result:
----------------
To get the timeout value
Actual result:
--------------
Always true, as it gets the address
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73854&edit=1