From 62bd1adb067bc6626f319a31a176ba94667e7c53 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Thu, 3 Dec 2020 12:35:18 +0330 Subject: [PATCH] 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 --- Shell/Parser.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Shell/Parser.cpp b/Shell/Parser.cpp index c6b322755c6..fe3f0a65c08 100644 --- a/Shell/Parser.cpp +++ b/Shell/Parser.cpp @@ -883,8 +883,7 @@ RefPtr 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(pipe_fd, dest_pipe_fd); // Redirection Fd2Fd if (dest_pipe_fd == -1)