mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00

Unlike the straight unserialize fuzzer, this runs only on HashContexts, and it does an update and finalize on the contexts it creates. Co-authored-by: Nikita Popov <nikic@php.net>
10 lines
274 B
PHP
10 lines
274 B
PHP
<?php
|
|
|
|
$corpusDir = __DIR__ . '/corpus/unserializehash';
|
|
@mkdir($corpusDir);
|
|
|
|
foreach (hash_algos() as $algo) {
|
|
$ctx = hash_init($algo);
|
|
$algx = preg_replace('/[^-_a-zA-Z0-9]/', '_', $algo);
|
|
file_put_contents($corpusDir . '/' . $algx, "x|" . serialize($ctx));
|
|
}
|