mirror of
https://github.com/php/php-src.git
synced 2025-01-02 08:54:04 +08:00
75ada661b9
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>
11 lines
274 B
PHP
11 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));
|
|
}
|