Fix inverted condition issue in check_32bit_address_range_loadable

This commit is contained in:
TuxSH committed 2018-05-08 13:45:37 +02:00
1 parent 1fd098e074
commit 880f49cfa5
3 files changed
+3 -3

No files matched your search

+1 -1
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 */
;