commit 4417bad83df4481ed58419b28c5c91b9649e2a86
Author: Christian Egli <christian.egli@sbs.ch>
Date:   Wed May 30 16:47:10 2018 +0200

    Fix another buffer overflow in table parsing reported by Henri Salo
    
    Fixes #575 and CVE-2018-11440

diff --git a/liblouis/compileTranslationTable.c b/liblouis/compileTranslationTable.c
index da6cdac9..d8d52b1d 100644
--- a/liblouis/compileTranslationTable.c
+++ b/liblouis/compileTranslationTable.c
@@ -1138,6 +1138,10 @@ parseChars(FileInfo *nested, CharsString *result, CharsString *token) {
 		utf32 = ch & (0XFF - first0Bit[numBytes]);
 		for (k = 0; k < numBytes; k++) {
 			if (in >= MAXSTRING) break;
+			if (out >= MAXSTRING) {
+				result->length = lastOutSize;
+				return 1;
+			}
 			if (token->chars[in] < 128 || (token->chars[in] & 0x0040)) {
 				compileWarning(nested, "invalid UTF-8. Assuming Latin-1.");
 				result->chars[out++] = token->chars[lastIn];
