Skip to content

Commit c9acf8e

Browse files
committedApr 17, 2024
[#90] fix(DaedalusScript): update broken bounds checks in find_symbol_by_index
1 parent 713480b commit c9acf8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/DaedalusScript.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ namespace zenkit {
142142
}
143143

144144
DaedalusSymbol const* DaedalusScript::find_symbol_by_index(std::uint32_t index) const {
145-
if (index > _m_symbols.size()) {
145+
if (index >= _m_symbols.size()) {
146146
return nullptr;
147147
}
148148
return &_m_symbols[index];
@@ -168,7 +168,7 @@ namespace zenkit {
168168
}
169169

170170
DaedalusSymbol* DaedalusScript::find_symbol_by_index(std::uint32_t index) {
171-
if (index > _m_symbols.size()) {
171+
if (index >= _m_symbols.size()) {
172172
return nullptr;
173173
}
174174
return &_m_symbols[index];

0 commit comments

Comments
 (0)
Please sign in to comment.