2
0
Fork 0

Fix segfault if trying to convert NULL address to string

This doesn't workaround the freebsd getsockname / getpeername bug,
but it shouldn't crash anymore.
http://www.freebsd.org/cgi/query-pr.cgi?pr=142717
personal/stbuehler/wip
Stefan Bühler 2010-01-11 20:56:51 +01:00
parent eaa13c2e4b
commit 4485ea7563
1 changed files with 5 additions and 0 deletions

View File

@ -535,6 +535,11 @@ GString *li_sockaddr_to_string(liSocketAddress addr, GString *dest, gboolean sho
guint8 oct;
liSockAddr *saddr = addr.addr;
if (!saddr) {
li_string_assign_len(dest, CONST_STR_LEN("<null>"));
return dest;
}
switch (saddr->plain.sa_family) {
case AF_INET:
/* ipv4 */