# HG changeset patch # User Ethan Blanton # Date 1310936112 0 # Node ID eb7dfb01640d65191af431da6b4c0da0837ea4bb # Parent 5a18f4d3b0624953d24ede93e38fcd260d224416 Complete the conversion of win32 utsname construction to bounds-checked access. This patch changes strcat to g_strlcat with appropriate bounds. diff -r 5a18f4d3b062 -r eb7dfb01640d libpurple/protocols/jabber/win32/posix.uname.c --- a/libpurple/protocols/jabber/win32/posix.uname.c Sun Jul 17 20:52:50 2011 +0000 +++ b/libpurple/protocols/jabber/win32/posix.uname.c Sun Jul 17 20:55:12 2011 +0000 @@ -58,28 +58,28 @@ 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; }