8349554: [UBSAN] os::attempt_reserve_memory_between reported applying non-zero offset to non-null pointer produced null pointer

Reviewed-by: stefank, stuefe
This commit is contained in:
SendaoYan 2025-02-08 13:11:07 +00:00
parent 7d52f1e64d
commit 8f6ccde982

View File

@ -2017,7 +2017,7 @@ char* os::attempt_reserve_memory_between(char* min, char* max, size_t bytes, siz
}
char* const hi_end = MIN2(max, absolute_max);
if ((uintptr_t)hi_end < bytes) {
if ((uintptr_t)hi_end <= bytes) {
return nullptr; // no need to go on
}
char* const hi_att = align_down(hi_end - bytes, alignment_adjusted);