fixed filePath allocation syze

This commit is contained in:
Václav Šmejkal 2022-11-23 19:45:07 +01:00
parent 5054284370
commit 488a59db56
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19

View File

@ -20,7 +20,7 @@ int initLogger(char *directoryPath)
struct tm tm = *localtime(&timeL); struct tm tm = *localtime(&timeL);
int buffer = 1; int buffer = 1;
int returning; 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 char *dateBuffer = malloc(strlen("yyyy-mm-dd") + 17); //TODO: MAKE THIS VARIABLE; FIND OUT WHY TF YOU NEED 17 MORE BYTES
DIR *dir; DIR *dir;