From d48cc3db3e0f7d524969f118f3dbde583d1b81c6 Mon Sep 17 00:00:00 2001 From: Akos Kiss Date: Thu, 17 Jan 2019 23:42:42 +0100 Subject: [PATCH] Fix buffer overflow while printing unhandled exception Fixes #2675 JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu --- jerry-main/main-unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jerry-main/main-unix.c b/jerry-main/main-unix.c index b8e5801614..dafbf4b33c 100644 --- a/jerry-main/main-unix.c +++ b/jerry-main/main-unix.c @@ -210,7 +210,7 @@ print_unhandled_exception (jerry_value_t error_value) /**< error value */ unsigned int pos = 0; /* 2. seek and print */ - while (buffer[pos] != '\0') + while ((pos < JERRY_BUFFER_SIZE) && (buffer[pos] != '\0')) { if (buffer[pos] == '\n') {