openbsd-ports/net/bitlbee/patches/patch-protocols_msn_sb_c

27 lines
1.0 KiB
Plaintext

$OpenBSD: patch-protocols_msn_sb_c,v 1.2 2006/04/11 15:11:33 naddy Exp $
--- protocols/msn/sb.c.orig Sun Apr 2 04:53:40 2006
+++ protocols/msn/sb.c Thu Apr 6 23:39:32 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' )
@@ -630,7 +631,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 );