Mercurial > pidgin
changeset 31776:eb7dfb01640d
Complete the conversion of win32 utsname construction to bounds-checked access.
This patch changes strcat to g_strlcat with appropriate bounds.
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Sun, 17 Jul 2011 20:55:12 +0000 |
parents | 5a18f4d3b062 |
children | 5498ee1aa30b |
files | libpurple/protocols/jabber/win32/posix.uname.c |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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; }