mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-12 10:33:52 +01:00
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 <andy@fud.org.nz>
This commit is contained in:
parent
543ad30e7d
commit
4f4cc73280
1
AUTHORS
1
AUTHORS
@ -2,6 +2,7 @@ Contributors
|
||||
============
|
||||
|
||||
Alexej Lotz <alexej.lotz@arcor.de>
|
||||
Andrew Thompson <andy@fud.org.nz>
|
||||
Asko Kauppi <askok@dnainternet.net>
|
||||
Barak Amar <barak.amar@gmail.com>
|
||||
Bernd Prager <bernd@prager.ws>
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user