Make sure we're never wrapping around the size value.
static inline int HCBDCreateSpace(DetectEngineThreadCtx *det_ctx, uint64_t size)
{
- if (size >= USHRT_MAX)
+ if (size >= (USHRT_MAX - BUFFER_STEP))
return -1;
void *ptmp;
static inline int HHDCreateSpace(DetectEngineThreadCtx *det_ctx, uint64_t size)
{
- if (size >= USHRT_MAX)
+ if (size >= (USHRT_MAX - BUFFER_STEP))
return -1;
void *ptmp;
static inline int HSBDCreateSpace(DetectEngineThreadCtx *det_ctx, uint64_t size)
{
- if (size >= USHRT_MAX)
+ if (size >= (USHRT_MAX - BUFFER_STEP))
return -1;
void *ptmp;