From 86432f8f866da9184a571f348bb60991f0181c93 Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Sat, 29 Jul 2017 20:26:21 +0100 Subject: [PATCH] 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. --- ircd/s_conf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ircd/s_conf.c b/ircd/s_conf.c index 37478611..87589332 100644 --- a/ircd/s_conf.c +++ b/ircd/s_conf.c @@ -590,11 +590,11 @@ attach_conf(struct Client *client_p, struct ConfItem *aconf) if(IsIllegal(aconf)) return (NOT_AUTHORISED); - if(ClassPtr(aconf)) - { - if(!add_ip_limit(client_p, aconf)) - return (TOO_MANY_LOCAL); - } + if(s_assert(ClassPtr(aconf))) + return (NOT_AUTHORISED); + + if(!add_ip_limit(client_p, aconf)) + return (TOO_MANY_LOCAL); if((aconf->status & CONF_CLIENT) && ConfCurrUsers(aconf) >= ConfMaxUsers(aconf) && ConfMaxUsers(aconf) > 0)