Skip to content

Commit

Permalink
Fix undefined method getDictionary() error
Browse files Browse the repository at this point in the history
Also move the call into try/catch to get more graceful error
reporting.

Fixes #15.
  • Loading branch information
nikic committed Aug 26, 2023
1 parent 0422e45 commit e6e2779
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Fuzzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,17 +408,17 @@ public function handleCliArgs(): int {
if (isset($opts['len-control-factor'])) {
$this->lenControlFactor = (int) $opts['len-control-factor'];
}
if (isset($opts['dict'])) {
$this->addDictionary($opts['dict']);
}

$this->loadTarget($getOpt->getOperand('target'));
try {
if (isset($opts['dict'])) {
$this->config->addDictionary($opts['dict']);
}

$this->setupTimeoutHandler();
$this->setupErrorHandler();
$this->setupShutdownHandler();
$this->loadTarget($getOpt->getOperand('target'));

try {
$this->setupTimeoutHandler();
$this->setupErrorHandler();
$this->setupShutdownHandler();
$command->getHandler()($getOpt);
} catch (FuzzerException $e) {
echo $e->getMessage() . PHP_EOL;
Expand Down

0 comments on commit e6e2779

Please sign in to comment.