com php-src: Fix opcache return type for hash_update_stream : ext/opcache/Optimizer/zend_func_info.c
| From: | Nikita Popov | Date: | Tue, 03 Sep 2019 07:23:39 +0000 |
| Subject: | com php-src: Fix opcache return type for hash_update_stream : ext/opcache/Optimizer/zend_func_info.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-108191@lists.php.net to get a copy of this message | ||
Commit: 9c3b7ccda5e3737c779e019eb1468213edaa2e39
Author: Tyson Andre <tysonandre775@hotmail.com> Mon, 2 Sep 2019 21:32:24 -0400
Committer: Nikita Popov <nikita.ppv@gmail.com> Tue, 3 Sep 2019 09:23:39 +0200
Parents: cd63908ab8f216d5095b2517eb90488cda2c321e
Branches: PHP-7.2 PHP-7.3 PHP-7.4 master
Link: http://git.php.net/?p=php-src..git;a=commitdiff;h=9c3b7ccda5e3737c779e019eb1468213edaa2e39
Log:
Fix opcache return type for hash_update_stream
It can return false if the resource type is wrong.
```
php > var_export(hash_update_stream(hash_init('md5'),
imagecreate(1,1)));
Warning: hash_update_stream(): supplied resource is not a valid stream
resource in php shell code on line 1
false
```
The return types were initially added in
c88ffa9a5673cb3141660626ba1921671f0b84d6
Changed paths:
M ext/opcache/Optimizer/zend_func_info.c
Diff:
diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c
index 7395540..919b4c3 100644
--- a/ext/opcache/Optimizer/zend_func_info.c
+++ b/ext/opcache/Optimizer/zend_func_info.c
@@ -1192,7 +1192,7 @@ static const func_info_t func_infos[] = {
F1("hash_hmac_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("hash_init", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
F0("hash_update", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("hash_update_stream", MAY_BE_NULL | MAY_BE_LONG),
+ F0("hash_update_stream", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
F0("hash_update_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F1("hash_final", MAY_BE_NULL | MAY_BE_STRING),
F1("hash_copy", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),