1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

Shell: Fix bad cast to BarewordLiteral

As found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28109&q=label%3AProj-serenity
This commit is contained in:
AnotherTest 2020-12-03 12:33:06 +03:30 committed by Andreas Kling
parent c1c5225b72
commit 9d9347cd5a

View file

@ -1380,7 +1380,7 @@ RefPtr<AST::Node> Parser::parse_glob()
auto glob_after = parse_glob();
if (glob_after) {
if (glob_after->is_glob()) {
auto glob = static_cast<AST::BarewordLiteral*>(glob_after.ptr());
auto glob = static_cast<AST::Glob*>(glob_after.ptr());
textbuilder.append(glob->text());
} else if (glob_after->is_bareword()) {
auto bareword = static_cast<AST::BarewordLiteral*>(glob_after.ptr());