Move scripts out of corpus/ directory

This commit is contained in:
Nikita Popov 2019-09-16 20:18:00 +02:00
parent c4e2ca607f
commit c1adb7a74e
4 changed files with 6 additions and 6 deletions

View File

@ -35,15 +35,15 @@ sapi/fuzzer/php-fuzz-exif ./my-exif-corpus
For the unserialize fuzzer, a dictionary of internal classes should be generated first:
```sh
sapi/cli/php sapi/fuzzer/corpus/generate_unserialize_dict.php
sapi/cli/php sapi/fuzzer/generate_unserialize_dict.php
cp -r sapi/fuzzer/corpus/unserialize ./my-unserialize-corpus
sapi/fuzzer/php-fuzz-unserialize -dict=$PWD/sapi/fuzzer/corpus/unserialize.dict ./my-unserialize-corpus
sapi/fuzzer/php-fuzz-unserialize -dict=$PWD/sapi/fuzzer/dict/unserialize ./my-unserialize-corpus
```
For the parser fuzzer, a corpus may be generated from Zend test files:
```sh
sapi/cli/php sapi/fuzzer/corpus/generate_parser_corpus.php
sapi/cli/php sapi/fuzzer/generate_parser_corpus.php
mkdir ./my-parser-corpus
sapi/fuzzer/php-fuzz-parser -merge=1 ./my-parser-corpus sapi/fuzzer/corpus/parser
sapi/fuzzer/php-fuzz-parser -only_ascii=1 ./my-parser-corpus

View File

@ -1,12 +1,12 @@
<?php
$testsDir = __DIR__ . '/../../../Zend/tests/';
$testsDir = __DIR__ . '/../../Zend/tests/';
$it = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($testsDir),
RecursiveIteratorIterator::LEAVES_ONLY
);
$corpusDir = __DIR__ . '/parser';
$corpusDir = __DIR__ . '/corpus/parser';
@mkdir($corpusDir);
foreach ($it as $file) {

View File

@ -6,4 +6,4 @@ foreach (get_declared_classes() as $class) {
$dict .= "\"$len:\\\"$class\\\"\"\n";
}
file_put_contents(__DIR__ . "/unserialize.dict", $dict);
file_put_contents(__DIR__ . "/dict/unserialize", $dict);