From cbf46c44ecec4e59375abdc5b409200b49d47ab9 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 20 Aug 2015 19:31:23 +0200 Subject: [PATCH] transaction inspection: fix limit enforcement Make sure we're never wrapping around the size value. --- src/detect-engine-hcbd.c | 2 +- src/detect-engine-hhd.c | 2 +- src/detect-engine-hsbd.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/detect-engine-hcbd.c b/src/detect-engine-hcbd.c index a1e47e6be4..09b7980a1c 100644 --- a/src/detect-engine-hcbd.c +++ b/src/detect-engine-hcbd.c @@ -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; diff --git a/src/detect-engine-hhd.c b/src/detect-engine-hhd.c index baf5cf6672..3bec4fd2f2 100644 --- a/src/detect-engine-hhd.c +++ b/src/detect-engine-hhd.c @@ -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; diff --git a/src/detect-engine-hsbd.c b/src/detect-engine-hsbd.c index a6319db67f..7d52c7d8f6 100644 --- a/src/detect-engine-hsbd.c +++ b/src/detect-engine-hsbd.c @@ -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;