From 768957e0fcf1ecab7d9e380f4cba5168011c2176 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sat, 17 Mar 2018 07:13:21 +0000 Subject: [PATCH] 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. --- src/libespeak-ng/compilembrola.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libespeak-ng/compilembrola.c b/src/libespeak-ng/compilembrola.c index 4c40f84e..c7ce5155 100644 --- a/src/libespeak-ng/compilembrola.c +++ b/src/libespeak-ng/compilembrola.c @@ -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;