Skip to content

Commit 35c17c1

Browse files
DavidSpickettadrian-prantl
authored andcommitted
[lldb] Fix off by one in array index check in Objective C runtime plugin (llvm#118995)
Reported in llvm#116944 / https://pvs-studio.com/en/blog/posts/cpp/1188/. (cherry picked from commit a46ee73)
1 parent 119bd56 commit 35c17c1

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
@@ -3291,7 +3291,7 @@ bool AppleObjCRuntimeV2::NonPointerISACache::EvaluateNonPointerISA(
32913291
}
32923292

32933293
// If the index is still out of range then this isn't a pointer.
3294-
if (index > m_indexed_isa_cache.size())
3294+
if (index >= m_indexed_isa_cache.size())
32953295
return false;
32963296

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

0 commit comments

Comments
 (0)