]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
reputation: declare max value as constant
authorGiuseppe Longo <giuseppe@glongo.it>
Thu, 7 Mar 2019 15:41:50 +0000 (16:41 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 22 Mar 2019 11:52:03 +0000 (12:52 +0100)
src/reputation.c
src/reputation.h

index 560ffdd394e9e412ec92288afd7c5743e8f25b82..0a65960de6a3486e829fddd7bd788df80b6f5242 100644 (file)
@@ -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;
     }
 
index 26024597541db7a242e4d5249ed8ce4e29ab76e4..57755465f7166cb3381713beb145a193b8399bf1 100644 (file)
@@ -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];