From 4387ad9fc64e95f94734194b7f565c33edbc8765 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Sat, 16 Jul 2022 10:15:51 +0430 Subject: [PATCH] js: Don't pass error strings as the format argument to outln() This fixes a crash when the error contains '{}', or an invalid format string. --- Userland/Utilities/js.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index 1d3b1b5b2d..375efd69ce 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -1187,7 +1187,7 @@ static bool parse_and_run(JS::Interpreter& interpreter, StringView source, Strin auto hint = error.source_location_hint(source); if (!hint.is_empty()) outln("{}", hint); - outln(error.to_string()); + outln("{}", error.to_string()); result = interpreter.vm().throw_completion(interpreter.global_object(), error.to_string()); } else { auto return_early = run_script_or_module(script_or_error.value());