Skip to content

Commit a46ee73

Browse files
[lldb] Fix off by one in array index check in Objective C runtime plugin (#118995)
Reported in #116944 / https://pvs-studio.com/en/blog/posts/cpp/1188/.
1 parent 4f7f71b commit a46ee73

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)