From 37a936ffda07438bfe935daf8c11d7b54f9bbba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Tue, 3 Nov 2020 22:51:58 -0300 Subject: [PATCH] Fix off-by-one allocation error in gemini. Forgot to account for additional slash. --- gemini.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gemini.c b/gemini.c index 5f10a57..fdd427a 100644 --- a/gemini.c +++ b/gemini.c @@ -145,7 +145,8 @@ void free_gemini_redirect_link(void) char *walk_gemini_path(const char *path, const char *append) { size_t path_len = strlen(path), app_len = strlen(append); - char *rv = calloc(1, path_len + app_len + 1); + // enough to fit both strings + one additional slash + null termination + char *rv = calloc(1, path_len + app_len + 1 + 1); if (rv == NULL) { return NULL; }