# HG changeset patch # User Ethan Blanton # Date 1310935970 0 # Node ID 5a18f4d3b0624953d24ede93e38fcd260d224416 # Parent 4ad2a0668687eaed82d9f410591b29c552e965ca Fill out struct utsname on win32 using g_strlcpy instead of strcpy. Thanks to the Electronic Frontier Foundation (https://www.eff.org/) for this patch. diff -r 4ad2a0668687 -r 5a18f4d3b062 libpurple/protocols/jabber/win32/posix.uname.c --- a/libpurple/protocols/jabber/win32/posix.uname.c Sun Jul 17 20:36:15 2011 +0000 +++ b/libpurple/protocols/jabber/win32/posix.uname.c Sun Jul 17 20:52:50 2011 +0000 @@ -54,7 +54,7 @@ GetVersionEx ( &OS_version ); GetSystemInfo ( &System_Info ); - strcpy( uts->sysname, "WIN32_" ); + g_strlcpy( uts->sysname, "WIN32_" , sizeof(uts->sysname)); switch( OS_version.dwPlatformId ) { case VER_PLATFORM_WIN32_NT: @@ -92,13 +92,13 @@ switch( System_Info.wProcessorArchitecture ) { case PROCESSOR_ARCHITECTURE_PPC: - strcpy( uts->machine, "ppc" ); + g_strlcpy( uts->machine, "ppc" , sizeof( uts->machine ) ); break; case PROCESSOR_ARCHITECTURE_ALPHA: - strcpy( uts->machine, "alpha" ); + g_strlcpy( uts->machine, "alpha" , sizeof( uts->machine ) ); break; case PROCESSOR_ARCHITECTURE_MIPS: - strcpy( uts->machine, "mips" ); + g_strlcpy( uts->machine, "mips" , sizeof( uts->machine ) ); break; case PROCESSOR_ARCHITECTURE_INTEL: /* dwProcessorType is only valid in Win95 and Win98 @@ -115,7 +115,7 @@ sprintf( uts->machine, "i%ld", System_Info.dwProcessorType ); break; default: - strcpy( uts->machine, "i386" ); + g_strlcpy( uts->machine, "i386" , sizeof( uts->machine ) ); break; } break; @@ -123,12 +123,12 @@ sprintf( uts->machine, "i%d86", System_Info.wProcessorLevel ); break; default: - strcpy( uts->machine, "unknown" ); + g_strlcpy( uts->machine, "unknown" , sizeof( uts->machine ) ); break; } break; default: - strcpy( uts->machine, "unknown" ); + g_strlcpy( uts->machine, "unknown" , sizeof( uts->machine ) ); break; }