pidgin/ljfisher-ssl-client-auth

7216d16cf3bc
Parents d98bb67efec6
Children 8f2d0081358a
Copy hostname fallbacks using g_strlcpy instead of strcpy.

Thanks to the Electronic Frontier Foundation (https://www.eff.org/) for
this patch.
--- a/libpurple/proxy.c Sun Jul 17 20:55:12 2011 +0000
+++ b/libpurple/proxy.c Sun Jul 17 21:04:52 2011 +0000
@@ -981,7 +981,7 @@
hostname[sizeof(hostname) - 1] = '\0';
if (ret < 0 || hostname[0] == '\0') {
purple_debug_warning("proxy", "gethostname() failed -- is your hostname set?");
- strcpy(hostname, "localhost");
+ g_strlcpy(hostname, "localhost", sizeof(hostname));
}
if (domain != NULL)
@@ -1115,7 +1115,7 @@
hostname[sizeof(hostname) - 1] = '\0';
if (ret < 0 || hostname[0] == '\0') {
purple_debug_warning("proxy", "gethostname() failed -- is your hostname set?");
- strcpy(hostname, "localhost");
+ g_strlcpy(hostname, "localhost", sizeof(hostname));
}
t1 = g_strdup_printf("%s:%s",