+2007-11-17 Michael Poole <mdpoole@troilus.org>
+
+ * ircd/m_stats.c (m_stats): Properly assign param before it is
+ used in the hunt_server_cmd() call.
+
2007-11-17 Michael Poole <mdpoole@troilus.org>
* ircd/s_auth.c (iauth_disconnect): Avoid destroying invalid
m_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
const struct StatDesc *sd;
- char *param = 0;
+ char *param;
/* If we didn't find a descriptor, send them help */
if ((parc < 2) || !(sd = stats_find(parv[1])))
((sd->sd_flags & STAT_FLAG_OPERFEAT) && feature_bool(sd->sd_control))))
return send_reply(sptr, ERR_NOPRIVILEGES);
+ /* Check for extra parameter */
+ if ((sd->sd_flags & STAT_FLAG_VARPARAM) && parc > 3 && !EmptyString(parv[3]))
+ param = parv[3];
+ else
+ param = NULL;
+
/* Ok, track down who's supposed to get this... */
if (hunt_server_cmd(sptr, CMD_STATS, cptr, feature_int(FEAT_HIS_REMOTE),
param ? "%s %C :%s" : "%s :%C", 2, parc, parv) !=
if ((sd->sd_flags & STAT_FLAG_LOCONLY) && !MyUser(sptr))
return send_reply(sptr, ERR_NOPRIVILEGES);
- /* Check for extra parameter */
- if ((sd->sd_flags & STAT_FLAG_VARPARAM) && parc > 3 && !EmptyString(parv[3]))
- param = parv[3];
-
assert(sd->sd_func != 0);
/* Ok, dispatch the stats function */