]> jfr.im git - irc/charybdis-ircd/charybdis.git/commitdiff
whois: check target is an oper before assuming they have a privset
authorAaron Jones <redacted>
Tue, 20 Sep 2016 13:46:33 +0000 (13:46 +0000)
committerAaron Jones <redacted>
Tue, 20 Sep 2016 13:47:55 +0000 (13:47 +0000)
The CHALLENGE functionality will set opername but not privset --
if an oper performs a WHOIS on someone currently half-way through
a challenge we will perform a NULL dereference.

Related to ircd-seven commit d7b05f7583babf6

modules/m_whois.c

index a43b9109dc8022c81f5591edefa34a3feef0ba44..d5e33ec6f455d51d92b23fded5c519539bbea895 100644 (file)
@@ -320,7 +320,7 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
                                    GlobalSetOptions.operstring));
        }
 
-       if(MyClient(target_p) && !EmptyString(target_p->localClient->opername) && IsOper(source_p))
+       if(MyClient(target_p) && !EmptyString(target_p->localClient->opername) && IsOper(target_p) && IsOper(source_p))
        {
                char buf[512];
                snprintf(buf, sizeof(buf), "is opered as %s, privset %s",