]> jfr.im git - solanum.git/commitdiff
Don't crash on receiving GRANT from a server
authorStephen Bennett <redacted>
Sun, 20 Nov 2022 13:32:10 +0000 (13:32 +0000)
committerDoug Freed <redacted>
Tue, 22 Nov 2022 09:33:35 +0000 (03:33 -0600)
modules/m_grant.c

index 0f41f4c72e1a609efea3c67cc1a68de651316f05..4681ee2162bea8c95b62aaa0c9d66b0683973f3a 100644 (file)
@@ -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))