ircd: attach_conf: avoid clang static analysis warning

In the impossible scenario where ClassPtr(aconf) is NULL, reject the
client instead of dereferencing the NULL pointer.
This commit is contained in:
Simon Arlott 2017-07-29 20:26:21 +01:00
parent b5ad4cdfde
commit 86432f8f86
No known key found for this signature in database
GPG key ID: C8975F2043CA5D24

View file

@ -590,11 +590,11 @@ attach_conf(struct Client *client_p, struct ConfItem *aconf)
if(IsIllegal(aconf)) if(IsIllegal(aconf))
return (NOT_AUTHORISED); return (NOT_AUTHORISED);
if(ClassPtr(aconf)) if(s_assert(ClassPtr(aconf)))
{ return (NOT_AUTHORISED);
if(!add_ip_limit(client_p, aconf))
return (TOO_MANY_LOCAL); if(!add_ip_limit(client_p, aconf))
} return (TOO_MANY_LOCAL);
if((aconf->status & CONF_CLIENT) && if((aconf->status & CONF_CLIENT) &&
ConfCurrUsers(aconf) >= ConfMaxUsers(aconf) && ConfMaxUsers(aconf) > 0) ConfCurrUsers(aconf) >= ConfMaxUsers(aconf) && ConfMaxUsers(aconf) > 0)