Skip to content

Commit b8956d0

Browse files
committed
tls: fix access to array (out of bounds)
1 parent 44f8670 commit b8956d0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/core/src/system.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,9 +1089,10 @@ class TlsStorage
10891089

10901090
for(size_t i = 0; i < threads.size(); i++)
10911091
{
1092-
if(threads[i]->slots[slotIdx])
1092+
std::vector<void*>& thread_slots = threads[i]->slots;
1093+
if (thread_slots.size() > slotIdx && thread_slots[slotIdx])
10931094
{
1094-
dataVec.push_back(threads[i]->slots[slotIdx]);
1095+
dataVec.push_back(thread_slots[slotIdx]);
10951096
threads[i]->slots[slotIdx] = 0;
10961097
}
10971098
}

0 commit comments

Comments
 (0)