From 6b2a5ef21eae5f7a55bfb0aac6805a2fc703263f Mon Sep 17 00:00:00 2001 From: Giuseppe Longo Date: Thu, 7 Mar 2019 16:41:50 +0100 Subject: [PATCH] reputation: declare max value as constant --- src/reputation.c | 2 +- src/reputation.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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];