From 3d5d60bc5bfe3a8ce6c95da59dcfdad2040d4664 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 29 Jun 2021 16:37:29 +0530 Subject: [PATCH] ... --- kitty/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/parser.c b/kitty/parser.c index fd31f8653..cd58c303e 100644 --- a/kitty/parser.c +++ b/kitty/parser.c @@ -1463,7 +1463,7 @@ do_parse_bytes(Screen *screen, const uint8_t *read_buf, const size_t read_buf_sz state = START; break; } - screen->pending_mode.capacity = MAX(screen->pending_mode.capacity * 2, screen->pending_mode.used + read_buf_sz); + screen->pending_mode.capacity = MAX(screen->pending_mode.capacity * 2, screen->pending_mode.used + read_buf_sz + sizeof(screen->pending_mode.stop_buf)); screen->pending_mode.buf = realloc(screen->pending_mode.buf, screen->pending_mode.capacity); if (!screen->pending_mode.buf) fatal("Out of memory"); }