transaction inspection: fix limit enforcement

Make sure we're never wrapping around the size value.
pull/1613/head
Victor Julien 10 years ago
parent 834c36659e
commit cbf46c44ec

@ -64,7 +64,7 @@
static inline int HCBDCreateSpace(DetectEngineThreadCtx *det_ctx, uint64_t size)
{
if (size >= USHRT_MAX)
if (size >= (USHRT_MAX - BUFFER_STEP))
return -1;
void *ptmp;

@ -62,7 +62,7 @@
static inline int HHDCreateSpace(DetectEngineThreadCtx *det_ctx, uint64_t size)
{
if (size >= USHRT_MAX)
if (size >= (USHRT_MAX - BUFFER_STEP))
return -1;
void *ptmp;

@ -66,7 +66,7 @@
static inline int HSBDCreateSpace(DetectEngineThreadCtx *det_ctx, uint64_t size)
{
if (size >= USHRT_MAX)
if (size >= (USHRT_MAX - BUFFER_STEP))
return -1;
void *ptmp;

Loading…
Cancel
Save