From 22270bd25952b3bab0fe8249e3692cd4a0cb2c53 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Wed, 26 Jul 2017 21:11:44 +0100 Subject: [PATCH] Fix reading hash table entries > 128. This is related to ebfa320956169e3419234b72fee51bd596867661, but when reading the hash chain entry length, not writing it. If char is signed, then before this change the length would be negative, causing problems loading the dictionary. --- 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 febddd93..ef887f9c 100644 --- a/src/libespeak-ng/dictionary.c +++ b/src/libespeak-ng/dictionary.c @@ -254,7 +254,7 @@ int LoadDictionary(Translator *tr, const char *name, int no_error) for (hash = 0; hash < N_HASH_DICT; hash++) { tr->dict_hashtab[hash] = p; - while ((length = *p) != 0) + while ((length = *(uint8_t *)p) != 0) p += length; p++; // skip over the zero which terminates the list for this hash value }