From 988db184eaf1021ee41d54efd3314b8ab2445363 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Tue, 12 Sep 2017 07:17:46 +0100 Subject: [PATCH] Prevent invalid access to word in LookupDictList. Clang static analysis reports this as several 'Result of operation is garbage or undefined' errors. --- src/libespeak-ng/dictionary.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libespeak-ng/dictionary.c b/src/libespeak-ng/dictionary.c index ef887f9c..ccb154b6 100644 --- a/src/libespeak-ng/dictionary.c +++ b/src/libespeak-ng/dictionary.c @@ -2894,7 +2894,7 @@ int LookupDictList(Translator *tr, char **wordptr, char *ph_out, unsigned int *f found = word2 + len; } - if (found == 0) { + if (found == 0 && length >= 2) { ph_out[0] = 0; // try modifications to find a recognised word