From 488a59db56687d65a70a64668c7a3c40bfe0560b Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 23 Nov 2022 19:45:07 +0100 Subject: [PATCH] fixed filePath allocation syze --- src/logger/lib/logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logger/lib/logger.c b/src/logger/lib/logger.c index 02a81fc..4abab01 100644 --- a/src/logger/lib/logger.c +++ b/src/logger/lib/logger.c @@ -20,7 +20,7 @@ int initLogger(char *directoryPath) struct tm tm = *localtime(&timeL); int buffer = 1; int returning; - char *filePath = malloc(strlen(directoryPath) + strlen(LOG_FORMAT) + 1); + char *filePath = malloc(strlen(directoryPath) + strlen(LOG_FORMAT) + 2); char *dateBuffer = malloc(strlen("yyyy-mm-dd") + 17); //TODO: MAKE THIS VARIABLE; FIND OUT WHY TF YOU NEED 17 MORE BYTES DIR *dir;