[arbel] Avoid potential integer overflow when calculating memory mappings
authorMichael Brown <mcb30@ipxe.org>
Tue, 21 Mar 2017 09:46:17 +0000 (11:46 +0200)
committerMichael Brown <mcb30@ipxe.org>
Tue, 21 Mar 2017 10:01:55 +0000 (12:01 +0200)
commita5affc832e2ae5fbbc88aafa452354fa418578b4
tree780ef1c36836945b27e911312040578f0fd7a853
parent6ee62eb24220d8e364728c007f0d6cb8285e544a
[arbel] Avoid potential integer overflow when calculating memory mappings

When the area to be mapped straddles the 2GB boundary, the expression
(high+size) will overflow on the first loop iteration.  Fix by using
(end-size), which cannot underflow.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/infiniband/arbel.c