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; }