Changeset c029350


Ignore:
Timestamp:
2008-03-16T17:17:23Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
6612cc9
Parents:
ec0355f
Message:

Added some brackets in irc_cmd_(pass|oper) to prevent crashes when no
passwords were set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_commands.c

    rec0355f rc029350  
    3131{
    3232        if( global.conf->auth_pass &&
    33             strncmp( global.conf->auth_pass, "md5:", 4 ) == 0 ?
    34               md5_verify_password( cmd[1], global.conf->auth_pass + 4 ) == 0 :
    35               strcmp( cmd[1], global.conf->auth_pass ) == 0 )
     33            ( strncmp( global.conf->auth_pass, "md5:", 4 ) == 0 ?
     34                md5_verify_password( cmd[1], global.conf->auth_pass + 4 ) == 0 :
     35                strcmp( cmd[1], global.conf->auth_pass ) == 0 ) )
    3636        {
    3737                irc->status |= USTATUS_AUTHORIZED;
     
    9292{
    9393        if( global.conf->oper_pass &&
    94             strncmp( global.conf->oper_pass, "md5:", 4 ) == 0 ?
    95               md5_verify_password( cmd[2], global.conf->oper_pass + 4 ) == 0 :
    96               strcmp( cmd[2], global.conf->oper_pass ) == 0 )
     94            ( strncmp( global.conf->oper_pass, "md5:", 4 ) == 0 ?
     95                md5_verify_password( cmd[2], global.conf->oper_pass + 4 ) == 0 :
     96                strcmp( cmd[2], global.conf->oper_pass ) == 0 ) )
    9797        {
    9898                irc_umode_set( irc, "+o", 1 );
Note: See TracChangeset for help on using the changeset viewer.