pidgin/ljfisher-ssl-client-auth

Parents e1b3f14fba94
Children d98bb67efec6
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.
--- 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;
}