From: B.Greenham Date: Mon, 22 Nov 2010 16:14:44 +0000 (-0500) Subject: Don't segfault if someone tries to OACCEPT a server for some inane reason. X-Git-Tag: shadowircd-6.3.0-RC1~44 X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/commitdiff_plain/be293b018b3a113891284f682a503e0ae02b23bf Don't segfault if someone tries to OACCEPT a server for some inane reason. --- diff --git a/extensions/m_oaccept.c b/extensions/m_oaccept.c index f24012b..268d443 100644 --- a/extensions/m_oaccept.c +++ b/extensions/m_oaccept.c @@ -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