pidgin: 45ca437e: Fill out struct utsname on win32 using g...

elb at pidgin.im elb at pidgin.im
Thu Aug 11 10:51:31 EDT 2011


----------------------------------------------------------------------
Revision: 45ca437e5aa6cb101bd10980da312710aa730148
Parent:   511ee00a153ae001ee68bb7b4d81b912f370e1ef
Author:   elb at pidgin.im
Date:     07/17/11 16:52:50
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/45ca437e5aa6cb101bd10980da312710aa730148

Changelog: 

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.

Changes against parent 511ee00a153ae001ee68bb7b4d81b912f370e1ef

  patched  libpurple/protocols/jabber/win32/posix.uname.c

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/win32/posix.uname.c	8a27a6a052455fd96041813242a1a78dd2e1f7ca
+++ libpurple/protocols/jabber/win32/posix.uname.c	9209c40a5d75550f8957c7fe7f8e0d96886bac4a
@@ -54,7 +54,7 @@ jabber_win32_uname( struct utsname *uts 
   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 @@ jabber_win32_uname( struct utsname *uts 
   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 @@ jabber_win32_uname( struct utsname *uts 
               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 @@ jabber_win32_uname( struct utsname *uts 
 	  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;
   }
 


More information about the Commits mailing list