Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/jabber.c @ 32237:514092c20438
Change another hostname lookup fallback to use g_strlcpy.
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:14:23 +0000 |
parents | 4f1bd59cb90a |
children | ac43f26c7f61 |
comparison
equal
deleted
inserted
replaced
32236:5f6bbe89d873 | 32237:514092c20438 |
---|---|
197 is if the hostname is longer than the buffer, in which case | 197 is if the hostname is longer than the buffer, in which case |
198 glibc 2.2+ would still fill the buffer with partial | 198 glibc 2.2+ would still fill the buffer with partial |
199 hostname, so maybe we want to detect that and use it | 199 hostname, so maybe we want to detect that and use it |
200 instead | 200 instead |
201 */ | 201 */ |
202 strcpy(hostname, "localhost"); | 202 g_strlcpy(hostname, "localhost", sizeof(hostname)); |
203 } | 203 } |
204 hostname[sizeof(hostname) - 1] = '\0'; | 204 hostname[sizeof(hostname) - 1] = '\0'; |
205 | 205 |
206 /* We want only the short hostname, not the FQDN - this will prevent the | 206 /* We want only the short hostname, not the FQDN - this will prevent the |
207 * resource string from being unreasonably long on systems which stuff the | 207 * resource string from being unreasonably long on systems which stuff the |