progpilot icon indicating copy to clipboard operation
progpilot copied to clipboard

Undefined property: PhpParser\Node\Stmt\Class_

Open abhayganjoo92 opened this issue 5 years ago • 1 comments

Hi

am getting below error while running progpilot

PHP Notice: Undefined property: PhpParser\Node\Stmt\Class_::$namespacedName in /vendor/ircmaxell/php-cfg/lib/PHPCfg/AstVisitor/MagicStringResolver.php on line 32 PHP Fatal error: Uncaught Error: Call to a member function toString() on null in /vendor/ircmaxell/php-cfg/lib/PHPCfg/AstVisitor/MagicStringResolver.php:32 Stack trace: #0 /vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(123): PHPCfg\AstVisitor\MagicStringResolver->enterNode(Object(PhpParser\Node\Stmt\Class_)) #1 /vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Expr\New_)) #2 /vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Expr\Assign)) #3 /vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(223): PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Stmt\Expression)) #4 /vendor/ircmaxell/php-cfg/lib/PHPCfg/AstVisitor/MagicStringResolver.php on line 32

any idea how this can be fixed ?

abhayganjoo92 avatar Nov 10 '20 17:11 abhayganjoo92

Hi can you try to use the latest version of progpilot to see if it solves the problem?

there is a open issue about this in the corresponding dependency used by progpilot https://github.com/ircmaxell/php-cfg/issues/53 I recommend you that to comment this issue to try to warn the maintainer

also surround progpilot analysis with try/catch, this way the analysis will not fail, see the answer here: https://github.com/designsecurity/progpilot/issues/20

Eric

eric-therond avatar Dec 04 '20 19:12 eric-therond

Done in v1.0.0

eric-therond avatar Dec 02 '22 20:12 eric-therond

progpilot version (v1.0.2) solves this.

eric-therond avatar Feb 12 '23 07:02 eric-therond