mirror of
https://github.com/tnodir/fort
synced 2024-11-15 07:25:18 +00:00
UI: IocContainer: Check array index.
This commit is contained in:
parent
e15cb97f0f
commit
3cd7bb7db0
@ -17,7 +17,7 @@ void IocContainer::setObject(int typeId, IocObject *obj, quint8 flags)
|
||||
{
|
||||
const int newSize = typeId + 1;
|
||||
if (newSize > m_size) {
|
||||
if (Q_UNLIKELY(newSize > IOC_MAX_SIZE)) {
|
||||
if (Q_UNLIKELY(newSize >= IOC_MAX_SIZE)) {
|
||||
qCritical() << "IoC Container size error";
|
||||
Q_UNREACHABLE();
|
||||
abort();
|
||||
|
@ -88,6 +88,7 @@ public:
|
||||
static int getTypeId()
|
||||
{
|
||||
static const int typeId = getNextTypeId();
|
||||
Q_ASSERT(typeId < IOC_MAX_SIZE);
|
||||
return typeId;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user