From f26681c735449815752dbc6ae7960235f97c7aa9 Mon Sep 17 00:00:00 2001 From: Stephen Bennett Date: Sun, 20 Nov 2022 13:32:10 +0000 Subject: [PATCH] Don't crash on receiving GRANT from a server --- modules/m_grant.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/m_grant.c b/modules/m_grant.c index 0f41f4c7..4681ee21 100644 --- a/modules/m_grant.c +++ b/modules/m_grant.c @@ -84,6 +84,12 @@ static int do_grant(struct Client *source_p, struct Client *target_p, const char int dooper = 0, dodeoper = 0; struct PrivilegeSet *privset = NULL, *old_privset = NULL; + if (!IsPerson(source_p)) + { + /* This can only happen if a broken server sends us nonsense, so ignore it */ + return 0; + } + if (!strcasecmp(new_privset, "deoper")) { if (!IsOper(target_p))