From 7b82e39793c8055a87385058a7cde39a371ce47e Mon Sep 17 00:00:00 2001 From: Rui Batista Date: Wed, 5 Oct 2016 13:15:48 +0100 Subject: [PATCH] Make strcpy calls in load dictionary copy at most 40 bytes so clang __strcpy_check does not get triggered (possible buffer overflow?) --- src/libespeak-ng/dictionary.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libespeak-ng/dictionary.c b/src/libespeak-ng/dictionary.c index f4d9204e..39119249 100644 --- a/src/libespeak-ng/dictionary.c +++ b/src/libespeak-ng/dictionary.c @@ -210,8 +210,8 @@ int LoadDictionary(Translator *tr, const char *name, int no_error) unsigned int size; char fname[sizeof(path_home)+20]; - strcpy(dictionary_name, name); // currently loaded dictionary name - strcpy(tr->dictionary_name, name); + strncpy(dictionary_name, name, 40); // currently loaded dictionary name + strncpy(tr->dictionary_name, name, 40); // Load a pronunciation data file into memory // bytes 0-3: offset to rules data