Check the index before the array is accessed in the call item.
Task-number: QTCREATORBUG-5576
Change-Id: I3f533ef76af42dad97c93087f2d434b58fdedd44
Reviewed-on: http://codereview.qt.nokia.com/2044
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
d.putSubItem(Item(p["t"], item.iname, i))
p = p["n"]
+qqLocalesCount = None
def qdump__QLocale(d, item):
+ # Check for uninitialized 'index' variable. Retrieve size of QLocale data array
+ # from variable in qlocale.cpp (default: 368/Qt 4.8), 368 being 'System'.
+ global qqLocalesCount
+ if qqLocalesCount is None:
+ try:
+ qqLocalesCount = int(value(qtNamespace() + 'locale_data_size'))
+ except:
+ qqLocalesCount = 368
+ index = int(item.value["p"]["index"])
+ check(index >= 0 and index <= qqLocalesCount)
d.putStringValue(call(item.value, "name"))
d.putNumChild(0)
return