From fef7b346d5b4de0c2232edaaca092b8460551711 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Thu, 24 Oct 2024 21:36:40 +0100 Subject: [PATCH] core: fix stringstream indent stack pointer not being initialised --- core/stringstream.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/stringstream.c b/core/stringstream.c index c6052b0..6b00850 100644 --- a/core/stringstream.c +++ b/core/stringstream.c @@ -6,6 +6,8 @@ void b_stringstream_begin(b_stringstream *ss, char *buf, size_t max) { + memset(ss, 0x0, sizeof *ss); + ss->ss_buf = buf; ss->ss_max = max; ss->ss_len = 0; @@ -14,6 +16,8 @@ void b_stringstream_begin(b_stringstream *ss, char *buf, size_t max) void b_stringstream_begin_dynamic(b_stringstream *ss) { + memset(ss, 0x0, sizeof *ss); + ss->ss_buf = NULL; ss->ss_max = 0; ss->ss_len = 0;