Fix inverted condition issue in check_32bit_address_range_loadable

This commit is contained in:
TuxSH 2018-05-07 23:57:56 +02:00
parent 1fd098e074
commit 880f49cfa5
3 changed files with 3 additions and 3 deletions

View file

@ -78,7 +78,7 @@ static inline bool check_32bit_address_loadable(uintptr_t addr) {
static inline bool check_32bit_address_range_loadable(uintptr_t addr, size_t size) {
return
__builtin_add_overflow_p(addr, size, (uintptr_t)0) && /* the range doesn't overflow */
!__builtin_add_overflow_p(addr, size, (uintptr_t)0) && /* the range doesn't overflow */
check_32bit_address_loadable(addr) && check_32bit_address_loadable(addr + size) && /* bounds are valid */
!(addr >= 0x40010000u && addr + size >= 0x40040000u) /* the range doesn't cross MMIO */
;