]> sourceware.org Git - glibc.git/commitdiff
* resolv/tst-aton.c: Add testcase for IP with four points.
authorAndreas Jaeger <aj@suse.de>
Sun, 4 Mar 2001 17:11:25 +0000 (17:11 +0000)
committerAndreas Jaeger <aj@suse.de>
Sun, 4 Mar 2001 17:11:25 +0000 (17:11 +0000)
* resolv/inet_addr.c: Don't recognize an IP with four points.
Patch by Andre' Breiler <A.Breiler@gmx.net>.

resolv/inet_addr.c
resolv/tst-aton.c

index 59e160e435573fced948886dcf9d9b91a622c483..83f2ec695e1ff19c51a33063d96799c0bf72c11e 100644 (file)
@@ -183,7 +183,7 @@ __inet_aton(const char *cp, struct in_addr *addr) {
                         *      a.b.c   (with c treated as 16 bits)
                         *      a.b     (with b treated as 24 bits)
                         */
-                       if (pp > res.bytes + 3 || val > 0xff)
+                       if (pp > res.bytes + 2 || val > 0xff)
                                goto ret_0;
                        *pp++ = val;
                        c = *++cp;
index 79077b00c34dae6b5b72c28626cd58b5af89c4a9..3469b192604b20244500ee54bec7685739b2a8c8 100644 (file)
@@ -39,6 +39,7 @@ static struct tests
   { "1.2.256.4", 0, 0 },
   { "1.2.3.0x100", 0, 0 },
   { "323543357756889", 0, 0 },
+  { "10.1.2.3.4", 0, 0},  
 };
 
 
This page took 0.043595 seconds and 5 git commands to generate.