From 311f7397f5dce5f9b0206590fb4712cdc019c434 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Mon, 18 Sep 2023 09:16:17 +0200 Subject: [PATCH] Fix NULL pointer crash due to reputation code changes from yesterday --- src/modules/reputation.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/reputation.c b/src/modules/reputation.c index 4cfa10a46..ac26cc65f 100644 --- a/src/modules/reputation.c +++ b/src/modules/reputation.c @@ -1334,6 +1334,8 @@ CMD_FUNC(reputation_server_cmd) if (score > REPUTATION_SCORE_CAP) score = REPUTATION_SCORE_CAP; + if (score < 0) + score = 0; e = find_reputation_entry(ip); if (allow_reply && e && (e->score > score) && (e->score - score > UPDATE_SCORE_MARGIN)) @@ -1365,7 +1367,7 @@ CMD_FUNC(reputation_server_cmd) e->score = score; reputation_changed_update_users(e); } else - if (forced) + if (e && forced) { #ifdef DEBUGMODE unreal_log(ULOG_DEBUG, "reputation", "REPUTATION_DECREASE", client,