From 0dd5df4060c5a7b47391ec14b427e17626c3d615 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 27 Apr 2024 03:21:05 -0400 Subject: [BugFix] tlsf get_new_area should return 0u or OOM Change-Id: I24f67a3a28237b7c1035932f69b7f526471bb8ef --- apps/plugins/lua/tlsf_helper.c | 3 ++- lib/tlsf/src/tlsf.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/plugins/lua/tlsf_helper.c b/apps/plugins/lua/tlsf_helper.c index 664d87c34e..e0da99f6fb 100644 --- a/apps/plugins/lua/tlsf_helper.c +++ b/apps/plugins/lua/tlsf_helper.c @@ -95,5 +95,6 @@ void *get_new_area(size_t *size) return audiobuf_ptr; } - return ((void *) ~0); + *size = 0; + return ((void *) ~0u); } diff --git a/lib/tlsf/src/tlsf.c b/lib/tlsf/src/tlsf.c index 7943770975..9df176ce16 100644 --- a/lib/tlsf/src/tlsf.c +++ b/lib/tlsf/src/tlsf.c @@ -469,7 +469,7 @@ static __inline__ void corrupt(const char *msg) { void * __attribute__((weak)) get_new_area(size_t * size) { (void)size; - return ((void *) ~0); + return ((void *) ~0u); } #endif -- cgit v1.2.3