Skip to content

Commit

Permalink
fix: 内置的luat_heap_calloc实现有错误,导致mbedtls的mpi计算会出错
Browse files Browse the repository at this point in the history
  • Loading branch information
wendal committed Dec 7, 2024
1 parent 5aacd5d commit 919bc41
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bsp/mini/port/luat_malloc_mini.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion components/rsa/binding/luat_lib_rsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion luat/weak/luat_malloc_weak.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 919bc41

Please sign in to comment.