From 35829a524bd5b0fc113fb8c6ff3ac9f8ffd33f56 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 28 Nov 2020 15:28:14 +0000 Subject: [PATCH] added the mimimum size check for an externally allocated zone to xma --- hawk/lib/xma.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hawk/lib/xma.c b/hawk/lib/xma.c index bbb97d8e..307a3d8d 100644 --- a/hawk/lib/xma.c +++ b/hawk/lib/xma.c @@ -232,6 +232,12 @@ int hawk_xma_init (hawk_xma_t* xma, hawk_mmgr_t* mmgr, void* zoneptr, hawk_oow_t 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 = (hawk_xma_fblk_t*)zoneptr;