Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81115075 authored by Amith Yamasani's avatar Amith Yamasani Committed by Jean-Baptiste Queru
Browse files

Fix a stack overflow when typing long words. Limit the size of auto-added words.

parent 63fa90a7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1169,6 +1169,9 @@ public class LatinIME extends InputMethodService

        @Override
        public void addWord(String word, int addFrequency) {
            final int length = word.length();
            // Don't add very short or very long words.
            if (length < 2 || length > getMaxWordLength()) return;
            super.addWord(word, addFrequency);
            final int freq = getWordFrequency(word);
            if (freq > PROMOTION_THRESHOLD) {