mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed out of bounds write.
This commit is contained in:
parent
0035cfac37
commit
906969d376
|
@ -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;
|
size_t motd_length = tmp_motd_length > MAX_MOTD_LENGTH ? MAX_MOTD_LENGTH : tmp_motd_length;
|
||||||
*motd = malloc(motd_length);
|
*motd = malloc(motd_length);
|
||||||
strncpy(*motd, tmp_motd, motd_length);
|
strncpy(*motd, tmp_motd, motd_length);
|
||||||
(*motd)[MAX_MOTD_LENGTH - 1] = '\0';
|
(*motd)[motd_length - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
config_destroy(&cfg);
|
config_destroy(&cfg);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user