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
Notes: sideshowbarker 2024-07-19 01:04:40 +09:00

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());