This caused a read from already free'd memory, if the processed
command (IRC_QUIT) calls Client_Destroy. (from HEAD)
#include "portab.h"
-static char UNUSED id[] = "$Id: parse.c,v 1.67 2006/04/23 10:37:27 fw Exp $";
+static char UNUSED id[] = "$Id: parse.c,v 1.67.2.1 2008/02/05 13:15:05 fw Exp $";
/**
* @file
char str[LINE_LEN];
bool result;
COMMAND *cmd;
- int i;
+ int i, client_type;
assert( Idx >= 0 );
assert( Req != NULL );
}
cmd = My_Commands;
+ client_type = Client_Type( client );
while( cmd->name )
{
/* Befehl suchen */
cmd++; continue;
}
- if( Client_Type( client ) & cmd->type )
+ if( client_type & cmd->type )
{
/* Command is allowed for this client: call it and count produced bytes */
Conn_ResetWCounter( );
cmd->bytes += Conn_WCounter( );
/* Adjust counters */
- if( Client_Type( client ) != CLIENT_SERVER ) cmd->lcount++;
+ if( client_type != CLIENT_SERVER ) cmd->lcount++;
else cmd->rcount++;
return result;