forked from OSchip/llvm-project
[libunwind] Fix incorrect check for out-of-boundedness
If the personalityIndex (which is 0-based) is equal to the length of the personality array, we should error out. rdar://18013273
This commit is contained in:
parent
b9c1bd39d0
commit
9b211a5076
|
@ -1764,7 +1764,7 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(pint_t pc,
|
|||
(__builtin_ctz(UNWIND_PERSONALITY_MASK));
|
||||
if (personalityIndex != 0) {
|
||||
--personalityIndex; // change 1-based to zero-based index
|
||||
if (personalityIndex > sectionHeader.personalityArrayCount()) {
|
||||
if (personalityIndex >= sectionHeader.personalityArrayCount()) {
|
||||
_LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with personality index %d, "
|
||||
"but personality table has only %d entries",
|
||||
encoding, personalityIndex,
|
||||
|
|
Loading…
Reference in New Issue