From a2652d24479870a929a53be53724617f861ef9d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 12 Jan 2020 12:00:43 +0100 Subject: [PATCH] dcs: put: don't append data if buffer resize failed --- dcs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dcs.c b/dcs.c index ccbca07b..3191febe 100644 --- a/dcs.c +++ b/dcs.c @@ -67,7 +67,8 @@ void dcs_put(struct terminal *term, uint8_t c) { LOG_DBG("PUT: %c", c); - ensure_size(term, term->vt.dcs.idx + 1); + if (!ensure_size(term, term->vt.dcs.idx + 1)) + return; term->vt.dcs.data[term->vt.dcs.idx++] = c; }