mirror of git://git.sysmocom.de/ofono
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:
parent
57b4aa3678
commit
c56b66bf4b
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue