vcl/qt5/QtWidget.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) New commits: commit cc5583dd49377bcd8c019d11963ca170550466cc Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Feb 5 20:38:53 2022 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Feb 7 15:09:21 2022 +0100
qt5: crash entering ë with french IM which for me with french IM enabled on my keyboard is physically AltGr+[ (crashes here on trying to underline ¨ with a length of 2) then e. Change-Id: Id59bd84af2ab4d8403b11b1a13efb2bbdb608199 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129547 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx index 8f672bdd6bac..d974dc509daf 100644 --- a/vcl/qt5/QtWidget.cxx +++ b/vcl/qt5/QtWidget.cxx @@ -686,7 +686,15 @@ void QtWidget::inputMethodEvent(QInputMethodEvent* pEvent) if (aCharFormat.fontStrikeOut()) aETIP |= ExtTextInputAttr::RedText; for (int j = rAttr.start; j < rAttr.start + rAttr.length; j++) + { + SAL_WARN_IF(j >= static_cast<int>(aTextAttrs.size()), "vcl.qt", + "QInputMethodEvent::Attribute out of range. Broken range: " + << rAttr.start << "," << rAttr.start + rAttr.length + << " Legal range: 0," << aTextAttrs.size()); + if (j >= static_cast<int>(aTextAttrs.size())) + break; aTextAttrs[j] = aETIP; + } } break; }