From f4af71917507c94c7a6de28f6f901b5985b4ddc2 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 2 Mar 2020 20:40:45 +0100 Subject: [PATCH] do not read orders when password is wrong --- src/orderfile.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/orderfile.c b/src/orderfile.c index 12cb05834..5a3497b8e 100644 --- a/src/orderfile.c +++ b/src/orderfile.c @@ -232,20 +232,22 @@ typedef struct parser_state { static void handle_faction(void *userData, int no, const char *password) { parser_state *state = (parser_state *)userData; - faction * f = state->f = findfaction(no); + faction * f = findfaction(no); if (!f) { log_debug("orders for unknown faction %s", itoa36(no)); } else { + state->u = NULL; + state->next_order = NULL; + state->f = NULL; if (checkpasswd(f, password)) { + state->f = f; f->lastorders = turn; } else { log_debug("invalid password for faction %s", itoa36(no)); ADDMSG(&f->msgs, msg_message("wrongpasswd", "password", password)); } - state->u = NULL; - state->next_order = NULL; } }