$OpenBSD: patch-protocols_msn_sb_c,v 1.3 2007/01/14 21:53:01 simon Exp $ --- protocols/msn/sb.c.orig Sat Jun 24 17:00:44 2006 +++ protocols/msn/sb.c Fri Dec 15 21:20:07 2006 @@ -126,10 +126,11 @@ int msn_sb_sendmessage( struct msn_switc if( strcmp( text, TYPING_NOTIFICATION_MESSAGE ) != 0 ) { - buf = g_new0( char, sizeof( MSN_MESSAGE_HEADERS ) + strlen( text ) * 2 ); + size_t buf_len = sizeof( MSN_MESSAGE_HEADERS ) + strlen( text ) * 2; + buf = g_new0( char, buf_len); i = strlen( MSN_MESSAGE_HEADERS ); - strcpy( buf, MSN_MESSAGE_HEADERS ); + strlcpy( buf, MSN_MESSAGE_HEADERS, buf_len ); for( j = 0; text[j]; j ++ ) { if( text[j] == '\n' ) @@ -632,7 +633,7 @@ static int msn_sb_message( gpointer data } else { - strcpy( buf, "<< \x02""BitlBee\x02"" - Corrupted MSN filetransfer invitation message >>" ); + strlcpy( buf, "<< \x02""BitlBee\x02"" - Corrupted MSN filetransfer invitation message >>", sizeof(buf) ); } if( name ) g_free( name );