mirror of
https://repo.or.cz/socat.git
synced 2025-07-15 07:33:25 +00:00
Passive addresses like TCP-LISTEN with empty port bound to random
This commit is contained in:
parent
0ab324b173
commit
ad524a56b7
3 changed files with 51 additions and 0 deletions
3
xio-ip.c
3
xio-ip.c
|
@ -149,6 +149,9 @@ int xiogetaddrinfo(const char *node, const char *service,
|
|||
memset(sau, 0, *socklen);
|
||||
sau->soa.sa_family = family;
|
||||
|
||||
if (service && service[0]=='\0') {
|
||||
Error("empty port/service");
|
||||
}
|
||||
/* if service is numeric we don't want to have a lookup (might take long
|
||||
with NIS), so we handle this specially */
|
||||
if (service && isdigit(service[0]&0xff)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue