hiredis/fix-memory-uninitialized-in-fuzz-testcase.patch
cherry530 1bfbbb8fc2 fix memory uninitialized in fuzz testcase
Signed-off-by: cherry530 <xuping33@huawei.com>
(cherry picked from commit 58b1cf8b9b35faf706e430d96c85e9e8f1701baa)
2023-03-13 15:50:51 +08:00

14 lines
380 B
Diff

diff --git a/sds.c b/sds.c
index 49d2096..9d46dc4 100644
--- a/sds.c
+++ b/sds.c
@@ -513,7 +513,7 @@ sds sdscatvprintf(sds s, const char *fmt, va_list ap) {
} else {
buflen = sizeof(staticbuf);
}
-
+ memset(buf, 0, buflen);
/* Try with buffers two times bigger every time we fail to
* fit the string in the current buffer size. */
while(1) {