Changeset 75ec2c8


Ignore:
Timestamp:
2010-03-10T23:58:47Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
8b6b740
Parents:
a0bd4c2
Message:

Fixed an "off-by -1" bug in msn_findheader() that could probably be triggered
by incoming messages without headers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn_util.c

    ra0bd4c2 r75ec2c8  
    171171               
    172172                /* End of headers? */
    173                 if( strncmp( text + i - 2, "\n\n", 2 ) == 0 ||
    174                     strncmp( text + i - 4, "\r\n\r\n", 4 ) == 0 ||
    175                     strncmp( text + i - 2, "\r\r", 2 ) == 0 )
     173                if( ( i >= 4 && strncmp( text + i - 4, "\r\n\r\n", 4 ) == 0 ) ||
     174                    ( i >= 2 && ( strncmp( text + i - 2, "\n\n", 2 ) == 0 ||   
     175                                  strncmp( text + i - 2, "\r\r", 2 ) == 0 ) ) )
    176176                {
    177177                        break;
Note: See TracChangeset for help on using the changeset viewer.