diff options
author | Dimitris Papastamos <dimitris.papastamos@arm.com> | 2018-06-19 13:39:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-19 13:39:55 +0100 |
commit | c0b7606f914e2ab913f969fb3d1af1380a8590d3 (patch) | |
tree | 7c9d0eed7bfa02df9001e19f777eb952a5a8c973 /lib/xlat_tables_v2 | |
parent | ac0197d9d57777f445cbd7f19b0294c461ff7082 (diff) | |
parent | 75df62699b9911de0ed0b9b4e95c5d682910cc0e (diff) |
Merge pull request #1420 from Yann-lms/mm_cursor_size_check
xlat_v2: add a check on mm_cursor->size to avoid infinite loop
Diffstat (limited to 'lib/xlat_tables_v2')
-rw-r--r-- | lib/xlat_tables_v2/xlat_tables_internal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/xlat_tables_v2/xlat_tables_internal.c b/lib/xlat_tables_v2/xlat_tables_internal.c index 31d3365b..a38f97f2 100644 --- a/lib/xlat_tables_v2/xlat_tables_internal.c +++ b/lib/xlat_tables_v2/xlat_tables_internal.c @@ -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; /* |