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

27 lines
1.0 KiB
Plaintext
Raw Normal View History

$OpenBSD: patch-protocols_msn_sb_c,v 1.1 2004/06/20 16:27:49 naddy Exp $
--- protocols/msn/sb.c.orig 2004-04-25 19:52:35.000000000 +1000
+++ protocols/msn/sb.c 2004-06-09 19:18:09.000000000 +1000
@@ -122,10 +122,11 @@ int msn_sb_sendmessage( struct msn_switc
if( sb->ready )
{
char cmd[1024];
- char *buf = g_new0( char, sizeof( MSN_MESSAGE_HEADERS ) + strlen( text ) * 2 );
+ size_t buf_len = sizeof( MSN_MESSAGE_HEADERS ) + strlen( text ) * 2;
+ char *buf = g_new0( char, buf_len);
int i = strlen( MSN_MESSAGE_HEADERS ), j;
- strcpy( buf, MSN_MESSAGE_HEADERS );
+ strlcpy( buf, MSN_MESSAGE_HEADERS, buf_len );
for( j = 0; text[j]; j ++ )
{
if( text[j] == '\n' )
@@ -592,7 +593,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 );