From 919bc41527cfda33fc566fcbab84362f1281b1e8 Mon Sep 17 00:00:00 2001 From: Wendal Chen Date: Sat, 7 Dec 2024 18:44:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=86=85=E7=BD=AE=E7=9A=84luat=5Fheap?= =?UTF-8?q?=5Fcalloc=E5=AE=9E=E7=8E=B0=E6=9C=89=E9=94=99=E8=AF=AF,?= =?UTF-8?q?=E5=AF=BC=E8=87=B4mbedtls=E7=9A=84mpi=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E4=BC=9A=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/mini/port/luat_malloc_mini.c | 2 +- components/rsa/binding/luat_lib_rsa.c | 2 +- luat/weak/luat_malloc_weak.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bsp/mini/port/luat_malloc_mini.c b/bsp/mini/port/luat_malloc_mini.c index e5c58a150..66d01e6e4 100644 --- a/bsp/mini/port/luat_malloc_mini.c +++ b/bsp/mini/port/luat_malloc_mini.c @@ -29,7 +29,7 @@ void* luat_heap_realloc(void* ptr, size_t len) { void* luat_heap_calloc(size_t count, size_t _size) { void *ptr = luat_heap_malloc(count * _size); if (ptr) { - memset(ptr, 0, _size); + memset(ptr, 0, count * _size); } return ptr; } diff --git a/components/rsa/binding/luat_lib_rsa.c b/components/rsa/binding/luat_lib_rsa.c index bd3b9b82b..f09755cf8 100644 --- a/components/rsa/binding/luat_lib_rsa.c +++ b/components/rsa/binding/luat_lib_rsa.c @@ -43,7 +43,7 @@ end #include "luat_crypto.h" #include "luat_fs.h" -#define LUAT_LOG_TAG "rs" +#define LUAT_LOG_TAG "rsa" #include "luat_log.h" #include "mbedtls/rsa.h" diff --git a/luat/weak/luat_malloc_weak.c b/luat/weak/luat_malloc_weak.c index d158f30f5..ff00e9c5a 100644 --- a/luat/weak/luat_malloc_weak.c +++ b/luat/weak/luat_malloc_weak.c @@ -31,7 +31,7 @@ LUAT_WEAK void* luat_heap_realloc(void* ptr, size_t len) { LUAT_WEAK void* luat_heap_calloc(size_t count, size_t _size) { void *ptr = luat_heap_malloc(count * _size); if (ptr) { - memset(ptr, 0, _size); + memset(ptr, 0, count * _size); } return ptr; }