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
(from parent 1:
ac0a697
)
[Tizen] Prevent accessing invalid index
accepted/tizen/unified/20211215.125754
submit/tizen/20211214.091051
author
Seoyeon Kim
<seoyeon2.kim@samsung.com>
Tue, 14 Dec 2021 05:28:07 +0000
(14:28 +0900)
committer
Seoyeon Kim
<seoyeon2.kim@samsung.com>
Tue, 14 Dec 2021 05:28:09 +0000
(14:28 +0900)
This reverts commit
61c65ff82e80b793effc25abf729a2d3e4480356
.
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
80c6364
..
471e8b4
100644
(file)
--- a/
dali/public-api/common/dali-vector.h
+++ b/
dali/public-api/common/dali-vector.h
@@
-555,7
+555,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;