[calendar] Check out of bounds array access in QLocale lookup
ClosedPublic

Authored by davidedmundson on Dec 13 2019, 5:39 PM.

Details

Summary

If we have a broken locale setup we don't have any uiLanugages to look
up the relevant locale object for.

In that case use the system locale.

Test Plan

Had a crash here

#11 0x00007ff982aab0b2 in QList<QString>::at(int) const (this=0x7ffd50b1d928, i=0) at /opt/qt5/include/QtCore/qlist.h:571
#12 0x00007ff982aaaa4a in Calendar::monthName() const (this=0x5640cce026f0) at /home/david/projects/kde5/src/frameworks/plasma-framework/src/declarativeimports/calendar/calendar.cpp:202
#13 0x00007ff982aa14e9 in Calendar::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x5640cce026f0, _c=QMetaObject::ReadProperty, _id=9, _a=0x7ffd50b1dd40) at src/declarativeimports/calendar/calendarplugin_autogen/EWIEGA46WW/moc_calendar.cpp:340

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Dec 13 2019, 5:39 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 13 2019, 5:39 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
davidedmundson requested review of this revision.Dec 13 2019, 5:39 PM
vkrause accepted this revision.Dec 14 2019, 12:50 PM
This revision is now accepted and ready to land.Dec 14 2019, 12:50 PM
This revision was automatically updated to reflect the committed changes.