From d99b2bed1b170132d528c77484639b9ceea044fb Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 16 Mar 2021 14:24:31 +0800 Subject: [PATCH] http/string: append need one more byte for null --- src/plugins/http/src/httpParser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/http/src/httpParser.c b/src/plugins/http/src/httpParser.c index 669b352ab6..18cea56cfe 100644 --- a/src/plugins/http/src/httpParser.c +++ b/src/plugins/http/src/httpParser.c @@ -110,7 +110,7 @@ static void httpCleanupString(HttpString *str) { static int32_t httpAppendString(HttpString *str, const char *s, int32_t len) { if (str->size == 0) { str->pos = 0; - str->size = len; + str->size = len + 1; str->str = malloc(str->size); } else if (str->pos + len + 1 >= str->size) { str->size += len; -- GitLab