avoid setting instruction cache size to @count when Capstone uses user-customized memory management, which might fail in resource scarce env such as kernel

This commit is contained in:
Nguyen Anh Quynh 2014-09-30 13:28:02 +08:00
parent ac98ca0129
commit 50eeba2a86
1 changed files with 2 additions and 0 deletions

2
cs.c
View File

@ -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;