This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 9791249  fix array index range checking of gat[] in gran_alloc().
9791249 is described below

commit 979124928c4132659f34a1dc7f4ef539c956d955
Author: Oki Minabe <[email protected]>
AuthorDate: Fri Feb 18 00:08:32 2022 +0900

    fix array index range checking of gat[] in gran_alloc().
---
 mm/mm_gran/mm_granalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mm_gran/mm_granalloc.c b/mm/mm_gran/mm_granalloc.c
index 79ebdb0..8826431 100644
--- a/mm/mm_gran/mm_granalloc.c
+++ b/mm/mm_gran/mm_granalloc.c
@@ -113,7 +113,7 @@ FAR void *gran_alloc(GRAN_HANDLE handle, size_t size)
 
           /* Get the next entry from the GAT to support a 64 bit shift */
 
-          if (granidx < priv->ngranules)
+          if (granidx + 32 < priv->ngranules)
             {
               next = priv->gat[gatidx + 1];
             }

Reply via email to