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

New commits:
commit de72b5f7dd3893ef0d4655cb7943ac0e8ed3c81d
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:14:06 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/+/129539
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 6cb548c0d028..02bc22ee3d44 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -664,7 +664,15 @@ void Qt5Widget::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.qt5",
+                                        "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