From 0994206f710a4defc1eecfb78ab70ff57c58fcda Mon Sep 17 00:00:00 2001 From: Reef Turner Date: Wed, 19 Jul 2017 12:29:32 +0800 Subject: [PATCH] address buffer overrun when dict listx file has no trailling newline See ar_listx as an example. --- src/libespeak-ng/compiledict.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libespeak-ng/compiledict.c b/src/libespeak-ng/compiledict.c index 2472694e..c0006ea9 100644 --- a/src/libespeak-ng/compiledict.c +++ b/src/libespeak-ng/compiledict.c @@ -411,8 +411,8 @@ static int compile_line(char *linebuf, char *dict_line, int n_dict_line, int *ha step = LINE_PARSER_WORD; - c = 0; - while (c != '\n') { + c = *p; + while (c != '\n' && c != '\0') { c = *p; if ((c == '?') && (step == 0)) {