vcl/qt5/QtWidget.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 05b067f05c561b1993deeea84a5700805bc9c3a6
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Feb 5 20:38:53 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Feb 6 13:10:08 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/+/129538
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index d999ebbb7bd8..ca74b9d118f0 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -691,7 +691,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;
                 }

Reply via email to