summaryrefslogtreecommitdiff
path: root/gatchat
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2019-07-16 23:13:55 -0500
committerDenis Kenzior <denkenz@gmail.com>2019-07-16 23:15:10 -0500
commitc56b66bf4b5d0ff87e60e0cdca305be8e1c0840e (patch)
tree2789584bea4c0882c462cb98b131cc7a6343b353 /gatchat
parent57b4aa367881e2bd11e41e96f68e9e6fe1b8a403 (diff)
downloadofono-c56b66bf4b5d0ff87e60e0cdca305be8e1c0840e.tar.gz
gatchat: Fix use of unterminated strings
escaped_str was allocated of size escaped + 1. But we were only memsetting the first escaped characters.
Diffstat (limited to 'gatchat')
-rw-r--r--gatchat/gatutil.c2
1 files changed, 1 insertions, 1 deletions
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];