Fix off-by-one allocation error in gemini.

Forgot to account for additional slash.
This commit is contained in:
Érico Rolim 2020-11-03 22:51:58 -03:00
parent c252ef31f4
commit 37a936ffda
1 changed files with 2 additions and 1 deletions

View File

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