From: Michael Poole Date: Wed, 4 May 2005 02:55:38 +0000 (+0000) Subject: Fix a crash in /stats i . X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=c7052d26f3c0a422e73c218006dbbe14d42a9f0f;p=ircu2.10.12-pk.git Fix a crash in /stats i . git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1394 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index bca220a..bc0ba26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-05-03 Michael Poole + + * ircd/s_stats.c (stats_access): Update to use new CONF_CLIENT + fields, fixing crash found by nighty. + + 2005-05-02 Michael Poole * include/numeric.h (ERR_UPASS_SAME_APASS): New error message when diff --git a/ircd/s_stats.c b/ircd/s_stats.c index 9714157..6b02585 100644 --- a/ircd/s_stats.c +++ b/ircd/s_stats.c @@ -172,12 +172,15 @@ stats_access(struct Client *to, const struct StatDesc *sd, char *param) { if (aconf->status != CONF_CLIENT) continue; - if ((!wilds && (!match(aconf->host, param) || - !match(aconf->name, param))) || - (wilds && (!mmatch(param, aconf->host) || - !mmatch(param, aconf->name)))) + if (wilds ? ((aconf->host && !mmatch(aconf->host, param)) + || (aconf->name && !mmatch(aconf->name, param))) + : ((aconf->host && !match(param, aconf->host)) + || (aconf->name && !match(param, aconf->name)))) { - send_reply(to, RPL_STATSILINE, 'I', aconf->host, aconf->name, + send_reply(to, RPL_STATSILINE, + (aconf->host ? aconf->host : "*"), aconf->maximum, + (aconf->name && aconf->name[0] == ':' ? "0":""), + aconf->name ? aconf->name : "*", aconf->address.port, get_conf_class(aconf)); if (--count == 0) break;