CComponentsForm: prevent wrong id parameter if item size out of range

Origin commit data
------------------
Commit: d72603665c
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-11-14 (Fri, 14 Nov 2014)
This commit is contained in:
2014-11-14 23:38:52 +01:00
parent 5346dec1ed
commit 1f062fd43a

View File

@@ -250,6 +250,11 @@ int CComponentsForm::genIndex()
CComponentsItem* CComponentsForm::getCCItem(const uint& cc_item_id)
{
if (cc_item_id >= size()){
dprintf(DEBUG_NORMAL, "[CComponentsForm] [%s - %d] Error: parameter cc_item_id = %u, out of range (size = %u)...\n", __func__, __LINE__, cc_item_id, size());
return NULL;
}
if (v_cc_items[cc_item_id])
return v_cc_items[cc_item_id];
return NULL;