forked from qt-creator/qt-creator
Fix potential access beyond array end.
Change-Id: I81b3903858a9072ba2a4ac9e2df572c02fdb9281 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
committed by
Christian Stenger
parent
0749d66362
commit
11a3479b2a
@@ -73,7 +73,7 @@ static QIcon testTreeIcon(TestTreeItem::Type type)
|
||||
QIcon(QLatin1String(":/images/func.png")),
|
||||
QIcon(QLatin1String(":/images/data.png"))
|
||||
};
|
||||
if (static_cast<unsigned long>(type) >= sizeof(icons))
|
||||
if (int(type) >= int(sizeof icons / sizeof *icons))
|
||||
return icons[2];
|
||||
return icons[type];
|
||||
}
|
||||
|
Reference in New Issue
Block a user