]> granicus.if.org Git - php/commitdiff
Fix opcache return type for hash_update_stream
authorTyson Andre <tysonandre775@hotmail.com>
Tue, 3 Sep 2019 01:32:24 +0000 (21:32 -0400)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 3 Sep 2019 07:23:39 +0000 (09:23 +0200)
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

ext/opcache/Optimizer/zend_func_info.c

index 7395540beffa357307be2b4e8f8b5bc82836f7bd..919b4c3a34ea560ac49ce9ac1cbb97701c44bcac 100644 (file)
@@ -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),