From c56b66bf4b5d0ff87e60e0cdca305be8e1c0840e Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 16 Jul 2019 23:13:55 -0500 Subject: [PATCH] gatchat: Fix use of unterminated strings escaped_str was allocated of size escaped + 1. But we were only memsetting the first escaped characters. --- gatchat/gatutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gatchat/gatutil.c b/gatchat/gatutil.c index ea433bcb..be691b2a 100644 --- a/gatchat/gatutil.c +++ b/gatchat/gatutil.c @@ -67,7 +67,7 @@ void g_at_util_debug_chat(gboolean in, const char *str, gsize len, escaped_str[0] = type; escaped_str[1] = ' '; - memset(escaped_str + 2, '\0', escaped - 2); + memset(escaped_str + 2, '\0', escaped - 1); for (escaped = 2, i = 0; i < len; i++) { unsigned char c = str[i];