Commit 426fabe0 authored by Albert Astals Cid's avatar Albert Astals Cid

Fix crash in UnicodeGroupProber::HandleData with short strings

len needs to be >= 2 since we always access aBuf[1]

Fixes crash in https://build.kde.org/job/ktexteditor%20master%20kf5-qt5/PLATFORM=Linux,compiler=gcc/87/testReport/junit/%28root%29/TestSuite/encoding_one_char_latin_15_txt_create/

Backport of review 125340
parent 50d8aa71
......@@ -65,7 +65,7 @@ nsProbingState UnicodeGroupProber::HandleData(const char* aBuf, unsigned int aLe
static bool disableUTF16BE = false;
double weight_zero;
if (mActiveSM <= 0) {
if (mActiveSM <= 0 || aLen < 2) {
mState = eNotMe;
return mState;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment