From 50eeba2a86489ceaf13421bc7ea397f94df81c40 Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Tue, 30 Sep 2014 13:28:02 +0800 Subject: [PATCH] avoid setting instruction cache size to @count when Capstone uses user-customized memory management, which might fail in resource scarce env such as kernel --- cs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cs.c b/cs.c index 60dee78b..8881790b 100644 --- a/cs.c +++ b/cs.c @@ -436,8 +436,10 @@ size_t cs_disasm(csh ud, const uint8_t *buffer, size_t size, uint64_t offset, si handle->errnum = CS_ERR_OK; +#ifdef CAPSTONE_USE_SYS_DYN_MEM if (count > 0) cache_size = count; +#endif // save the original offset for SKIPDATA buffer_org = buffer;