From 170591a0b156bcd4a8687e3e039ba6b7f7b54d6b Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Mon, 19 Jun 2017 20:16:01 +0200 Subject: [PATCH] util-print: add 0 at end of buffer Add a 0 at the end of the printed buffer to be sure we terminate with a 0 to avoid problem when calling strlen(). --- src/util-print.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util-print.c b/src/util-print.c index 05ccafa777..544728b6fb 100644 --- a/src/util-print.c +++ b/src/util-print.c @@ -227,6 +227,7 @@ void PrintStringsToBuffer(uint8_t *dst_buf, uint32_t *dst_buf_offset_ptr, uint32 src_buf[ch] == '\n' || src_buf[ch] == '\r') ? (uint8_t)src_buf[ch] : '.'); } + dst_buf[dst_buf_size - 1] = 0; return; }