diff options
author | martin <martin@13f79535-47bb-0310-9956-ffa450edef68> | 2004-06-25 13:51:46 +0000 |
---|---|---|
committer | martin <martin@13f79535-47bb-0310-9956-ffa450edef68> | 2004-06-25 13:51:46 +0000 |
commit | b893911f1c6712fcb32c34b35acc4a12922dea0e (patch) | |
tree | 9143609c6b7c160e29e371724abe09434f10a5a9 /network_io | |
parent | 75c6e72511d4f921ca5669022b38742fbcd4617b (diff) | |
download | libapr-b893911f1c6712fcb32c34b35acc4a12922dea0e.tar.gz |
Reminder for bugginess
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65218 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io')
-rw-r--r-- | network_io/unix/sockaddr.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index f7d0e34be..6ab4e0322 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -767,6 +767,19 @@ static apr_status_t parse_network(apr_ipsubnet_t *ipsub, const char *network) if (shift < 0) { return APR_EBADIP; } +/*@@@ WARNING: BEWARE: +The man page for inet_pton()/inet_aton() et.al. says: + All numbers supplied as ``parts'' in a `.' notation may be decimal, + octal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). +OTOH, "man atoi" says: + The atoi() function [...] is equivalent to: + (int)strtol(nptr, (char **)NULL, 10); +which forces interpretation as _decimal_. As a result, this routine will +interpret a string 0177.0000.0000.0001 as 177.0.0.1, while inet_pton() +will interpret it as 127.0.0.1! +@@@*/ octet = atoi(s); if (octet < 0 || octet > 255) { return APR_EBADIP; |