aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/msn/msn_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/msn/msn_util.c')
-rw-r--r--protocols/msn/msn_util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/protocols/msn/msn_util.c b/protocols/msn/msn_util.c
index 6b12217b..668a8b8a 100644
--- a/protocols/msn/msn_util.c
+++ b/protocols/msn/msn_util.c
@@ -170,9 +170,9 @@ char *msn_findheader( char *text, char *header, int len )
while( i < len && ( text[i] == '\r' || text[i] == '\n' ) ) i ++;
/* End of headers? */
- if( strncmp( text + i - 2, "\n\n", 2 ) == 0 ||
- strncmp( text + i - 4, "\r\n\r\n", 4 ) == 0 ||
- strncmp( text + i - 2, "\r\r", 2 ) == 0 )
+ if( ( i >= 4 && strncmp( text + i - 4, "\r\n\r\n", 4 ) == 0 ) ||
+ ( i >= 2 && ( strncmp( text + i - 2, "\n\n", 2 ) == 0 ||
+ strncmp( text + i - 2, "\r\r", 2 ) == 0 ) ) )
{
break;
}