Blame SOURCES/0001-invalid-read-memory-access-624.patch
|
|
1d944c |
From ac938e2ecb48ab4dd21298126c7921689d60571b Mon Sep 17 00:00:00 2001
|
|
|
1d944c |
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
|
1d944c |
Date: Tue, 12 Nov 2019 20:03:15 +0000
|
|
|
1d944c |
Subject: [PATCH] invalid read memory access #624
|
|
|
1d944c |
|
|
|
1d944c |
---
|
|
|
1d944c |
src/hunspell/suggestmgr.cxx | 2 +-
|
|
|
1d944c |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
1d944c |
|
|
|
1d944c |
diff --git a/src/hunspell/suggestmgr.cxx b/src/hunspell/suggestmgr.cxx
|
|
|
1d944c |
index dba084e..c23f165 100644
|
|
|
1d944c |
--- a/src/hunspell/suggestmgr.cxx
|
|
|
1d944c |
+++ b/src/hunspell/suggestmgr.cxx
|
|
|
1d944c |
@@ -1812,7 +1812,7 @@ int SuggestMgr::leftcommonsubstring(char * s1, const char * s2) {
|
|
|
1d944c |
if (complexprefixes) {
|
|
|
1d944c |
int l1 = u8_u16(su1, MAXSWL, s1);
|
|
|
1d944c |
int l2 = u8_u16(su2, MAXSWL, s2);
|
|
|
1d944c |
- if (*((short *)su1+l1-1) == *((short *)su2+l2-1)) return 1;
|
|
|
1d944c |
+ if (l1 && l2 && *((short *)su1+l1-1) == *((short *)su2+l2-1)) return 1;
|
|
|
1d944c |
} else {
|
|
|
1d944c |
int i;
|
|
|
1d944c |
u8_u16(su1, 1, s1);
|
|
|
1d944c |
--
|
|
|
1d944c |
2.23.0
|
|
|
1d944c |
|