Skip to content

Commit 772a880

Browse files
akosthekissrobertsipka
authored andcommitted
Fix buffer overflow while printing unhandled exception (#2710)
Fixes #2675 JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
1 parent 77767c2 commit 772a880

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jerry-main/main-unix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ print_unhandled_exception (jerry_value_t error_value) /**< error value */
210210
unsigned int pos = 0;
211211

212212
/* 2. seek and print */
213-
while (buffer[pos] != '\0')
213+
while ((pos < JERRY_BUFFER_SIZE) && (buffer[pos] != '\0'))
214214
{
215215
if (buffer[pos] == '\n')
216216
{

0 commit comments

Comments
 (0)