8319542: Fix boundaries of region to be tested with os::is_readable_range

Reviewed-by: dlong, clanger
This commit is contained in:
Thomas Obermeier 2023-11-16 08:38:15 +00:00 committed by Dean Long
parent c36ec2ca70
commit b4c2d1c1af

View File

@ -212,7 +212,7 @@ bool MallocTracker::print_pointer_information(const void* p, outputStream* st) {
const uint8_t* const end = here - (0x1000 + sizeof(MallocHeader)); // stop searching after 4k
for (; here >= end; here -= smallest_possible_alignment) {
// JDK-8306561: cast to a MallocHeader needs to guarantee it can reside in readable memory
if (!os::is_readable_range(here, here + sizeof(MallocHeader) - 1)) {
if (!os::is_readable_range(here, here + sizeof(MallocHeader))) {
// Probably OOB, give up
break;
}