From 4f4cc7328054272fa2c972244b2b7e8378ad5429 Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Wed, 29 Jun 2011 23:48:19 +0200 Subject: Use strrchr to ensure we split off the last colon for the service port IPv6 addresses have colons and will produce invalid data for the getaddrinfo lookup. Signed-off-by: Andrew Thompson --- src/ip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ip.cpp') diff --git a/src/ip.cpp b/src/ip.cpp index c24d92f..a4f9562 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -272,7 +272,7 @@ int zmq::resolve_ip_hostname (sockaddr_storage *addr_, socklen_t *addr_len_, const char *hostname_) { // Find the ':' that separates hostname name from service. - const char *delimiter = strchr (hostname_, ':'); + const char *delimiter = strrchr (hostname_, ':'); if (!delimiter) { errno = EINVAL; return -1; -- cgit v1.2.3