Mercurial > pidgin
diff libpurple/proxy.c @ 31777:5498ee1aa30b
Copy hostname fallbacks using g_strlcpy instead of strcpy.
Thanks to the Electronic Frontier Foundation (https://www.eff.org/) for
this patch.
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Sun, 17 Jul 2011 21:04:52 +0000 |
parents | 3e11fa72c5d8 |
children | f22bc8b5b9dc 9f26efb70c67 3828a61c44da |
line wrap: on
line diff
--- 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",