Skip to content

Commit 6a227a0

Browse files
committed
[lldb] Fix off by one in array index check
Reported in #116944 / https://pvs-studio.com/en/blog/posts/cpp/1188/.
1 parent e68a3e4 commit 6a227a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3278,7 +3278,7 @@ bool AppleObjCRuntimeV2::NonPointerISACache::EvaluateNonPointerISA(
32783278
}
32793279

32803280
// If the index is still out of range then this isn't a pointer.
3281-
if (index > m_indexed_isa_cache.size())
3281+
if (index >= m_indexed_isa_cache.size())
32823282
return false;
32833283

32843284
LLDB_LOGF(log, "AOCRT::NPI Evaluate(ret_isa = 0x%" PRIx64 ")",

0 commit comments

Comments
 (0)