Fix malloc size for file path

We need 4 more characters to store the suffix.
This commit is contained in:
Akos Vandra-Meyer 2023-01-20 21:13:54 +01:00 committed by GitHub
parent 4e6fbae45c
commit e0d8ef20fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -452,7 +452,7 @@ void dynsec__config_save(void)
/* Save to file */
file_path_len = strlen(config_file) + 1;
file_path = mosquitto_malloc(file_path_len);
file_path = mosquitto_malloc(file_path_len + 4);
if(file_path == NULL){
mosquitto_free(json_str);
mosquitto_log_printf(MOSQ_LOG_ERR, "Error saving Dynamic security plugin config: Out of memory.\n");