apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject cvs commit: apr/network_io/unix sockaddr.c
Date Fri, 25 Jun 2004 13:51:46 GMT
martin      2004/06/25 06:51:46

  Modified:    network_io/unix sockaddr.c
  Log:
  Reminder for bugginess
  
  Revision  Changes    Path
  1.53      +13 -0     apr/network_io/unix/sockaddr.c
  
  Index: sockaddr.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sockaddr.c,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -u -r1.52 -r1.53
  --- sockaddr.c	1 Jun 2004 19:50:14 -0000	1.52
  +++ sockaddr.c	25 Jun 2004 13:51:46 -0000	1.53
  @@ -767,6 +767,19 @@
           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;
  
  
  

Mime
View raw message