mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 14:51:27 +02:00
CLEANUP: tools: Crash if inet_ntop fails due to ENOSPC in sa2str
This is impossible, because we pass a destination buffer that is appropriately sized to hold an IPv6 address. This is related to GitHub issue #1599.
This commit is contained in:
parent
162f0875ad
commit
22535a56a7
@ -1375,7 +1375,10 @@ char * sa2str(const struct sockaddr_storage *addr, int port, int map_ports)
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
inet_ntop(addr->ss_family, ptr, buffer, sizeof(buffer));
|
||||
if (inet_ntop(addr->ss_family, ptr, buffer, sizeof(buffer)) == NULL) {
|
||||
BUG_ON(errno == ENOSPC);
|
||||
return NULL;
|
||||
}
|
||||
if (map_ports)
|
||||
return memprintf(&out, "%s:%+d", buffer, port);
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user