Skip to content

Commit

Permalink
Updated fuzzer
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Nov 28, 2023
1 parent 3d2a936 commit 57bc678
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion fuzzer/target.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@
$fuzzer->setTarget(
function (string $input)
{
s9e\Bencode\Bencode::decode($input);
try
{
$decoded = s9e\Bencode\Bencode::decode($input);
if (s9e\Bencode\Bencode::encode($decoded) !== $input)
{
trigger_error('Does not match', E_USER_ERROR);
}
}
catch (s9e\Bencode\Exceptions\DecodingException $e)
{
}

s9e\Bencode\Bencode::decodeNonCompliant($input);
}
);
Expand Down

0 comments on commit 57bc678

Please sign in to comment.