http/string: append need one more byte for null

This commit is contained in:
Minglei Jin 2021-03-16 14:24:31 +08:00
parent 18c0457af2
commit d99b2bed1b
1 changed files with 1 additions and 1 deletions

View File

@ -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;