Browse Source

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 13 years ago
parent
commit
4485ea7563
  1. 5
      src/common/utils.c

5
src/common/utils.c

@ -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 */

Loading…
Cancel
Save