From 7b81290cd0fdd1af888905dd9334b3012bbdd41f Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 28 Nov 2020 15:28:00 +0000 Subject: [PATCH] added the mimimum size check for an externally allocated zone to xma --- qse/lib/cmn/xma.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qse/lib/cmn/xma.c b/qse/lib/cmn/xma.c index 0dc30d51..e817e8d3 100644 --- a/qse/lib/cmn/xma.c +++ b/qse/lib/cmn/xma.c @@ -232,6 +232,12 @@ int qse_xma_init (qse_xma_t* xma, qse_mmgr_t* mmgr, void* zoneptr, qse_size_t zo internal = 1; } + else if (zonesize < FBLKMINSIZE) + { + /* the zone size is too small for an externally allocated zone. */ +/* TODO: difference error code from memory allocation failure.. this is not really memory shortage */ + return -1; + } first = (qse_xma_fblk_t*)zoneptr;