Ban score should always increase.

Resolves: #246

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
This commit is contained in:
Alan Jowett
2020-02-14 13:36:17 -07:00
committed by Nikos Mavrogiannopoulos
parent 17957ed98f
commit 8d1aa343b4

View File

@@ -158,7 +158,9 @@ int add_ip_to_ban_list(main_server_st *s, const unsigned char *ip, unsigned ip_s
print_msg = 0;
} else
print_msg = 1;
e->score += score;
/* prevent overflow */
e->score = (e->score + score) > e->score ? (e->score + score) : (e->score);
if (ip_size == 4)
p_str_ip = inet_ntop(AF_INET, ip, str_ip, sizeof(str_ip));