1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/hash/tests/reuse.phpt
Max Semenik 10f5a06d3c Fix GH-12186: segfault copying/cloning a finalized HashContext
Closes GH-12186.
Closes GH-12187.
2023-09-16 21:18:27 +02:00

18 lines
297 B
PHP

--TEST--
Hash: Attempt to reuse a closed hash context
--FILE--
<?php
$h = hash_init('md5');
hash_final($h);
try {
hash_update($h, 'foo');
}
catch (\Error $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECT--
hash_update(): Argument #1 ($context) must be a valid, non-finalized HashContext