From 3630e10874fbc9b9947a17d87ad117183708223d Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 15 Apr 2023 20:35:52 -0400 Subject: [PATCH] haze: fix pointer overflow check --- troposphere/haze/include/haze/ptp_object_heap.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/troposphere/haze/include/haze/ptp_object_heap.hpp b/troposphere/haze/include/haze/ptp_object_heap.hpp index 719a8f193..ae333588f 100644 --- a/troposphere/haze/include/haze/ptp_object_heap.hpp +++ b/troposphere/haze/include/haze/ptp_object_heap.hpp @@ -56,7 +56,7 @@ namespace haze { constexpr bool AllocationIsSatisfyable(size_t n) const { /* Check for overflow. */ - if (this->GetNextAddress() + n < this->GetNextAddress()) { + if (!util::CanAddWithoutOverflow(reinterpret_cast(this->GetNextAddress()), n)) { return false; }