mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-07 15:04:39 +08:00
parent
c825eb3604
commit
651d0af0b6
@ -306,7 +306,11 @@ lwip_getaddrinfo(const char *nodename, const char *servname,
|
|||||||
/* service name specified: convert to port number
|
/* service name specified: convert to port number
|
||||||
* @todo?: currently, only ASCII integers (port numbers) are supported (AI_NUMERICSERV)! */
|
* @todo?: currently, only ASCII integers (port numbers) are supported (AI_NUMERICSERV)! */
|
||||||
port_nr = atoi(servname);
|
port_nr = atoi(servname);
|
||||||
if ((port_nr <= 0) || (port_nr > 0xffff)) {
|
if (port_nr == 0 && (servname[0] != '0')) {
|
||||||
|
/* atoi failed - service was not numeric */
|
||||||
|
return EAI_SERVICE;
|
||||||
|
}
|
||||||
|
if ((port_nr < 0) || (port_nr > 0xffff)) {
|
||||||
return EAI_SERVICE;
|
return EAI_SERVICE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user