# HG changeset patch # User Ethan Blanton # Date 1310936692 0 # Node ID 5498ee1aa30bc557b8470a1aab10432dd277b1da # Parent eb7dfb01640d65191af431da6b4c0da0837ea4bb Copy hostname fallbacks using g_strlcpy instead of strcpy. Thanks to the Electronic Frontier Foundation (https://www.eff.org/) for this patch. diff -r eb7dfb01640d -r 5498ee1aa30b libpurple/proxy.c --- 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",