Merge pull request #1420 from Yann-lms/mm_cursor_size_check

xlat_v2: add a check on mm_cursor->size to avoid infinite loop
This commit is contained in:
Dimitris Papastamos 2018-06-19 13:39:55 +01:00 committed by GitHub
commit c0b7606f91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -784,8 +784,8 @@ void mmap_add_region_ctx(xlat_ctx_t *ctx, const mmap_region_t *mm)
&& mm_cursor->size)
++mm_cursor;
while ((mm_cursor->base_va + mm_cursor->size - 1 == end_va)
&& (mm_cursor->size < mm->size))
while ((mm_cursor->base_va + mm_cursor->size - 1 == end_va) &&
(mm_cursor->size != 0U) && (mm_cursor->size < mm->size))
++mm_cursor;
/*