From: Victor Julien Date: Thu, 20 Aug 2015 17:31:23 +0000 (+0200) Subject: transaction inspection: fix limit enforcement X-Git-Tag: suricata-3.0RC1~185 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbf46c44ecec4e59375abdc5b409200b49d47ab9;p=thirdparty%2Fsuricata.git transaction inspection: fix limit enforcement Make sure we're never wrapping around the size value. --- 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;