File hunspell-CVE-2019-16707.patch of Package hunspell.15348

Index: hunspell-1.3.2/src/hunspell/suggestmgr.cxx
===================================================================
--- hunspell-1.3.2.orig/src/hunspell/suggestmgr.cxx	2020-06-09 09:03:51.470697736 +0200
+++ hunspell-1.3.2/src/hunspell/suggestmgr.cxx	2020-06-09 09:05:43.191272069 +0200
@@ -1812,7 +1812,7 @@ int SuggestMgr::leftcommonsubstring(char
     if (complexprefixes) {
       int l1 = u8_u16(su1, MAXSWL, s1);
       int l2 = u8_u16(su2, MAXSWL, s2);
-      if (*((short *)su1+l1-1) == *((short *)su2+l2-1)) return 1;
+      if (l1 && l2 && *((short *)su1+l1-1) == *((short *)su2+l2-1)) return 1;
     } else {
       int i;
       u8_u16(su1, 1, s1);
openSUSE Build Service is sponsored by