From 732404d4447f32a69b8ceee10d1fcdcfef52c616 Mon Sep 17 00:00:00 2001 From: Adrian Lopez Date: Tue, 18 Jun 2024 18:49:04 -0400 Subject: [PATCH] Fix buffer overflow issue in getrealpath() function. --- getrealpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/getrealpath.c b/getrealpath.c index edd907b..558af39 100644 --- a/getrealpath.c +++ b/getrealpath.c @@ -164,7 +164,7 @@ char *getrealpath(const char *path, unsigned int options) return 0; } - scratch = malloc(strlen(link) + strlen(basename) + 1); + scratch = malloc(strlen(link) + strlen(basename) + 2); if (scratch == 0) { free(basename);