fix issue 31 (#32)
authorFFreestanding <62629010+FFreestanding@users.noreply.github.com>
Tue, 26 Mar 2024 01:42:09 +0000 (09:42 +0800)
committerGitHub <noreply@github.com>
Tue, 26 Mar 2024 01:42:09 +0000 (09:42 +0800)
* fix out of bound write in __init_pile

---------

Co-authored-by: ffreestanding <achillesweb@qq.com>
lunaix-os/includes/lunaix/mm/cake.h

index bf92b268e21cb228a88a2397352436ac5ce3eb1c..cf1c16e63c49bdf89fcf6db10c8c6b6cf3d6c1e4 100644 (file)
@@ -24,7 +24,7 @@ struct cake_pile
     u32_t alloced_pieces;
     u32_t pieces_per_cake;
     u32_t pg_per_cake;
     u32_t alloced_pieces;
     u32_t pieces_per_cake;
     u32_t pg_per_cake;
-    char pile_name[PILE_NAME_MAXLEN];
+    char pile_name[PILE_NAME_MAXLEN+1];
 
     pile_cb ctor;
 };
 
     pile_cb ctor;
 };