Skip to content

Commit

Permalink
8319542: Fix boundaries of region to be tested with os::is_readable_r…
Browse files Browse the repository at this point in the history
…ange

Reviewed-by: dlong, clanger
  • Loading branch information
TOatGithub authored and dean-long committed Nov 16, 2023
1 parent c36ec2c commit b4c2d1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hotspot/share/nmt/mallocTracker.cpp
Expand Up @@ -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;
}
Expand Down

1 comment on commit b4c2d1c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.