allocating correct size in why2_get_authority_cert_path

This commit is contained in:
Václav Šmejkal 2025-02-01 17:32:06 +01:00
parent a42764f6d6
commit d799ff1e0c
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -191,7 +191,7 @@ char *why2_get_client_config_path(void)
char *why2_get_authority_cert_path(char *username)
{
char *buffer = config_path(AUTHORITY);
char *path = why2_malloc(strlen(buffer) + strlen(username) + strlen(WHY2_CHAT_AUTHORITY_CERTS_EXTENSION) + 2);
char *path = why2_malloc(strlen(buffer) + strlen(username) + strlen(WHY2_CHAT_AUTHORITY_CERTS_EXTENSION) + 3);
//GET THE FILE
sprintf(path, "%s/%s%s%c", buffer, username, WHY2_CHAT_AUTHORITY_CERTS_EXTENSION, '\0');