Return new UC_ERR_OVERFLOW instead of UC_ERR_NOMEM when reg buffer is too small

This commit is contained in:
Robert Xiao
2023-06-16 14:47:03 -07:00
parent b041345a73
commit 2b80ab425b
3 changed files with 16 additions and 9 deletions

View File

@@ -131,7 +131,7 @@ static inline void uc_common_init(struct uc_struct* uc)
#define CHECK_REG_TYPE(type) do { \
if (unlikely(*size < sizeof(type))) { \
return UC_ERR_NOMEM; \
return UC_ERR_OVERFLOW; \
} \
*size = sizeof(type); \
ret = UC_ERR_OK; \