Fix a crash in /stats i <server> <mask>.
authorMichael Poole <mdpoole@troilus.org>
Wed, 4 May 2005 02:55:38 +0000 (02:55 +0000)
committerMichael Poole <mdpoole@troilus.org>
Wed, 4 May 2005 02:55:38 +0000 (02:55 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1394 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/s_stats.c

index bca220a7f69c320ee9996e6cb5e7e23b7a7197d4..bc0ba26ddba521211df8187aa8c22f7105a982c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-05-03  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/s_stats.c (stats_access): Update to use new CONF_CLIENT
+       fields, fixing crash found by nighty.
+       
+
 2005-05-02  Michael Poole <mdpoole@troilus.org>
 
        * include/numeric.h (ERR_UPASS_SAME_APASS): New error message when
index 9714157616944cec13960e3df27ca664e79f2bb7..6b02585087ddbae1577a20d3fb487fd84f8920e2 100644 (file)
@@ -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;