projects
/
platform
/
core
/
uifw
/
dali-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
672d60b
)
[Tizen] Prevent accessing invalid index
00/266700/1
submit/tizen/20211207.091609
author
Heeyong Song
<heeyong.song@samsung.com>
Wed, 17 Nov 2021 09:21:07 +0000
(18:21 +0900)
committer
Heeyong Song
<heeyong.song@samsung.com>
Wed, 17 Nov 2021 09:21:07 +0000
(18:21 +0900)
Change-Id: I31ce3b658bff9dadcf235d87257c0ca6bf82705b
dali/public-api/common/dali-vector.h
patch
|
blob
|
history
diff --git
a/dali/public-api/common/dali-vector.h
b/dali/public-api/common/dali-vector.h
index
fd4565e
..
b461e1e
100644
(file)
--- a/
dali/public-api/common/dali-vector.h
+++ b/
dali/public-api/common/dali-vector.h
@@
-548,7
+548,11
@@
public: // API
const ItemType& operator[](SizeType index) const
{
DALI_ASSERT_VECTOR(VectorBase::mData && "Vector is empty");
- DALI_ASSERT_VECTOR(index < VectorBase::Count() && "Index out of bounds");
+ if(index >= VectorBase::Count())
+ {
+ // Prevent accessing invalid index
+ index = 0;
+ }
ItemType* address = reinterpret_cast<ItemType*>(VectorBase::mData);
address += index;
return *address;