pidgin: 7ca32691: Complete the conversion of win32 utsname...

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


----------------------------------------------------------------------
Revision: 7ca32691e054b9274c7e0d3105eb83aaa91ba75f
Parent:   45ca437e5aa6cb101bd10980da312710aa730148
Author:   elb at pidgin.im
Date:     07/17/11 16:55:12
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/7ca32691e054b9274c7e0d3105eb83aaa91ba75f

Changelog: 

Complete the conversion of win32 utsname construction to bounds-checked access.

This patch changes strcat to g_strlcat with appropriate bounds.

Changes against parent 45ca437e5aa6cb101bd10980da312710aa730148

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

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/win32/posix.uname.c	9209c40a5d75550f8957c7fe7f8e0d96886bac4a
+++ libpurple/protocols/jabber/win32/posix.uname.c	4d198a66735b29e9d69c989b9c3b940794dbaad3
@@ -58,28 +58,28 @@ jabber_win32_uname( struct utsname *uts 
   switch( OS_version.dwPlatformId )
   {
     case VER_PLATFORM_WIN32_NT:
-      strcat( uts->sysname, "WinNT" );
+      g_strlcat( uts->sysname, "WinNT", sizeof(uts->sysname) );
       MingwOS = WinNT;
       break;
     case VER_PLATFORM_WIN32_WINDOWS:
       switch ( OS_version.dwMinorVersion )
       {
         case 0:
-          strcat( uts->sysname, "Win95" );
+          g_strlcat( uts->sysname, "Win95", sizeof(uts->sysname) );
 	  MingwOS = Win95;
           break;
         case 10:
-          strcat( uts->sysname, "Win98" );
+          g_strlcat( uts->sysname, "Win98", sizeof(uts->sysname) );
 	  MingwOS = Win98;
           break;
         default:
-          strcat( uts->sysname, "Win??" );
+          g_strlcat( uts->sysname, "Win??", sizeof(uts->sysname) );
 	  MingwOS = unknown;
           break;
       }
       break;
     default:
-      strcat( uts->sysname, "Win??" );
+      g_strlcat( uts->sysname, "Win??", sizeof(uts->sysname) );
       MingwOS = unknown;
       break;
   }


More information about the Commits mailing list