summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util_sock.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index f77fcc9968..d061d73a81 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -70,7 +70,12 @@ static char *get_socket_addr(int fd)
socklen_t length = sizeof(sa);
static char addr_buf[INET6_ADDRSTRLEN];
- addr_buf[0] = '\0';
+ /* Ok, returning a hard coded IPv4 address
+ * is bogus, but it's just as bogus as a
+ * zero IPv6 address. No good choice here.
+ */
+
+ safe_strcpy(addr_buf, "0.0.0.0", sizeof(addr_buf)-1);
if (fd == -1) {
return addr_buf;