From 30c62e03b86573a3fc5df788bda4bb95d2d89f9b Mon Sep 17 00:00:00 2001 From: overflowerror Date: Sun, 23 May 2021 17:17:33 +0200 Subject: [PATCH] fixed off-by-one error when opening stream --- src/templates.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templates.c b/src/templates.c index b54aa95..d9f9863 100644 --- a/src/templates.c +++ b/src/templates.c @@ -128,7 +128,7 @@ char* renderTemplateStr(const char* name, ...) { return NULL; } - FILE* out = fmemopen(result, length, "w"); + FILE* out = fmemopen(result, length + 1, "w"); if (out == NULL) { va_end(argptr2); return NULL;