Mercurial > pidgin
changeset 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 | eb7dfb01640d |
children | 5f6bbe89d873 |
files | libpurple/proxy.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
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",