1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 00:05:06 +00:00

Shell: Replace one more user-controlled assert with a syntax error

test-case: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28114&q=label%3AProj-serenity
This commit is contained in:
AnotherTest 2020-12-03 12:35:18 +03:30 committed by Andreas Kling
parent 9d9347cd5a
commit 62bd1adb06

View file

@ -883,8 +883,7 @@ RefPtr<AST::Node> Parser::parse_redirection()
dest_pipe_fd = -1;
} else {
auto fd = number.to_int();
ASSERT(fd.has_value());
dest_pipe_fd = fd.value();
dest_pipe_fd = fd.value_or(-1);
}
auto redir = create<AST::Fd2FdRedirection>(pipe_fd, dest_pipe_fd); // Redirection Fd2Fd
if (dest_pipe_fd == -1)