Initial Commit
This commit is contained in:
17
dependencies/amphp/hpack/tools/php-fuzzer/decode-oracle.php
vendored
Normal file
17
dependencies/amphp/hpack/tools/php-fuzzer/decode-oracle.php
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace WP_Ultimo\Dependencies;
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
use WP_Ultimo\Dependencies\Amp\Http\Internal;
|
||||
$fuzzer->setTarget(function (string $input) {
|
||||
$result1 = (new Internal\HPackNghttp2())->decode($input, 8192);
|
||||
$result2 = (new Internal\HPackNative())->decode($input, 8192);
|
||||
if ($result1 === null || $result2 === null) {
|
||||
return;
|
||||
}
|
||||
if ($result1 !== $result2) {
|
||||
throw new \Error('Mismatch: ' . \var_export($result1, \true) . ' / ' . \var_export($result2, \true));
|
||||
}
|
||||
});
|
||||
$fuzzer->setMaxLen(1024);
|
Reference in New Issue
Block a user