From: Giuseppe Longo Date: Thu, 7 Mar 2019 15:41:50 +0000 (+0100) Subject: reputation: declare max value as constant X-Git-Tag: suricata-5.0.0-beta1~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b2a5ef21eae5f7a55bfb0aac6805a2fc703263f;p=thirdparty%2Fsuricata.git reputation: declare max value as constant --- diff --git a/src/reputation.c b/src/reputation.c index 560ffdd394..0a65960de6 100644 --- a/src/reputation.c +++ b/src/reputation.c @@ -311,7 +311,7 @@ static int SRepSplitLine(SRepCIDRTree *cidr_ctx, char *line, Address *ip, uint8_ } int v = atoi(ptrs[2]); - if (v < 0 || v > 127) { + if (v < 0 || v > SREP_MAX_VAL) { return -1; } diff --git a/src/reputation.h b/src/reputation.h index 2602459754..57755465f7 100644 --- a/src/reputation.h +++ b/src/reputation.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2007-2010 Open Information Security Foundation +/* Copyright (C) 2007-2019 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free @@ -29,6 +29,7 @@ #include "host.h" #define SREP_MAX_CATS 60 +#define SREP_MAX_VAL 127 typedef struct SRepCIDRTree_ { SCRadixTree *srepIPV4_tree[SREP_MAX_CATS];