gatchat: Fix use of unterminated strings

escaped_str was allocated of size escaped + 1.  But we were only
memsetting the first escaped characters.
This commit is contained in:
Denis Kenzior 2019-07-16 23:13:55 -05:00
parent 57b4aa3678
commit c56b66bf4b
1 changed files with 1 additions and 1 deletions

View File

@ -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];