]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Don't segfault if someone tries to OACCEPT a server for some inane reason.
authorB.Greenham <redacted>
Mon, 22 Nov 2010 16:14:44 +0000 (11:14 -0500)
committerB.Greenham <redacted>
Mon, 22 Nov 2010 16:14:44 +0000 (11:14 -0500)
extensions/m_oaccept.c

index f24012be32099730a5819f4b3b096c1f19c833c0..268d443ebe23ae408ca07012941a9cbf86b1d244 100644 (file)
@@ -31,6 +31,13 @@ mo_oaccept(struct Client *client_p, struct Client *source_p, int parc, const cha
                return 0;
        }
 
+       /* If we don't check for this, and some idiot tries to OACCEPT a server... */
+       if(!IsPerson(target_p))
+       {
+               sendto_one_notice(source_p, ":That is a server, not a user. What are you doing?");
+               return 0;
+       }
+
        rb_snprintf(text, sizeof(text), "O%s", source_p->id);
 
        /* Provide a nice error message if you try to OACCEPT someone