Fixed out of bounds write.

This commit is contained in:
irungentoo 2014-05-18 14:43:32 -04:00
parent 0035cfac37
commit 906969d376
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -290,7 +290,7 @@ int get_general_config(char *cfg_file_path, char **pid_file_path, char **keys_fi
size_t motd_length = tmp_motd_length > MAX_MOTD_LENGTH ? MAX_MOTD_LENGTH : tmp_motd_length;
*motd = malloc(motd_length);
strncpy(*motd, tmp_motd, motd_length);
(*motd)[MAX_MOTD_LENGTH - 1] = '\0';
(*motd)[motd_length - 1] = '\0';
}
config_destroy(&cfg);