david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[arbel] Assert that mapping length is non-zero

An (impossible) mapping length of zero produces a negative bit shift,
which is technically undefined.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2017-03-22 15:18:54 +02:00
parent 7495813792
commit 0ced99e97c
1 changed files with 1 additions and 0 deletions

View File

@ -1972,6 +1972,7 @@ static int arbel_map_vpm ( struct arbel *arbel,
assert ( ( va & ( ARBEL_PAGE_SIZE - 1 ) ) == 0 );
assert ( ( pa & ( ARBEL_PAGE_SIZE - 1 ) ) == 0 );
assert ( ( len & ( ARBEL_PAGE_SIZE - 1 ) ) == 0 );
assert ( len != 0 );
/* Calculate starting points */
start = pa;