Skip to content

Commit 8f6ccde

Browse files
author
SendaoYan
committed
8349554: [UBSAN] os::attempt_reserve_memory_between reported applying non-zero offset to non-null pointer produced null pointer
Reviewed-by: stefank, stuefe
1 parent 7d52f1e commit 8f6ccde

File tree

1 file changed

+1
-1
lines changed
  • src/hotspot/share/runtime

1 file changed

+1
-1
lines changed

src/hotspot/share/runtime/os.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,7 @@ char* os::attempt_reserve_memory_between(char* min, char* max, size_t bytes, siz
20172017
}
20182018

20192019
char* const hi_end = MIN2(max, absolute_max);
2020-
if ((uintptr_t)hi_end < bytes) {
2020+
if ((uintptr_t)hi_end <= bytes) {
20212021
return nullptr; // no need to go on
20222022
}
20232023
char* const hi_att = align_down(hi_end - bytes, alignment_adjusted);

0 commit comments

Comments
 (0)