mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-21 11:31:00 +00:00
Don't copy filepath to buf. [coverity]
No modification was being done to buf after the copy of filepath. It was just being passed to fopen. As such the copy is redundant, and can lead to buffer overflow issues if the specified filepath is larger than buf.
This commit is contained in:
@@ -86,9 +86,8 @@ espeak_ng_STATUS espeak_ng_CompileMbrolaVoice(const char *filepath, FILE *log, e
|
||||
int mbrola_ctrl = 20; // volume in 1/16 ths
|
||||
MBROLA_TAB data[N_PHONEME_TAB];
|
||||
|
||||
strcpy(buf, filepath);
|
||||
if ((f_in = fopen(buf, "r")) == NULL)
|
||||
return create_file_error_context(context, errno, buf);
|
||||
if ((f_in = fopen(filepath, "r")) == NULL)
|
||||
return create_file_error_context(context, errno, filepath);
|
||||
|
||||
while (fgets(buf, sizeof(phoneme), f_in) != NULL) {
|
||||
buf[sizeof(phoneme)-1] = 0;
|
||||
|
||||
Reference in New Issue
Block a user