Changeset e1720ce


Ignore:
Timestamp:
2008-12-14T01:38:59Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
939370c
Parents:
6d5eb72
Message:

Fixed a bug in the IRC parser where lines that start with a colon and don't
contain any spaces could make BitlBee read uninitialized memory (and
possibly even parse it as if it were a command).

Also fixed a small memory leak around there.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc.c

    r6d5eb72 re1720ce  
    407407                        }
    408408                       
    409                         if( lines[i] )
    410                         {
    411                                 if( ( cmd = irc_parse_line( lines[i] ) ) == NULL )
    412                                         continue;
     409                        if( lines[i] && ( cmd = irc_parse_line( lines[i] ) ) )
     410                        {
    413411                                irc_exec( irc, cmd );
    414412                                g_free( cmd );
     
    485483        if( line[0] == ':' )
    486484        {
    487                 for( i = 0; line[i] != ' '; i ++ );
     485                for( i = 0; line[i] && line[i] != ' '; i ++ );
    488486                line = line + i;
    489487        }
Note: See TracChangeset for help on using the changeset viewer.