mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
Move scripts out of corpus/ directory
This commit is contained in:
parent
c4e2ca607f
commit
c1adb7a74e
@ -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
|
||||
|
@ -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) {
|
@ -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);
|
Loading…
Reference in New Issue
Block a user