Module: xenomai-3
Branch: stable-3.0.x
Commit: 5abb09dab0035263b0f6233d54795230cdb8f37e
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5abb09dab0035263b0f6233d54795230cdb8f37e

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Apr 19 11:01:49 2018 +0200

copperplate/heapobj-pshared: fix off-by-one error in pagemap reset

---

 lib/copperplate/heapobj-pshared.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/copperplate/heapobj-pshared.c 
b/lib/copperplate/heapobj-pshared.c
index e523ce8..0a3c24e 100644
--- a/lib/copperplate/heapobj-pshared.c
+++ b/lib/copperplate/heapobj-pshared.c
@@ -156,7 +156,7 @@ static void init_extent(void *base, struct shared_extent 
*extent)
        assert(lastpgnum >= 1);
 
        /* Mark all pages as free in the page map. */
-       memset(extent->pagemap, 0, lastpgnum * sizeof(struct page_entry));
+       memset(extent->pagemap, 0, (lastpgnum + 1) * sizeof(struct page_entry));
 
        /* Clear the allocation bitmap. */
        p = __shref(base, extent->bitmap);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to