mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-18 06:30:05 +00:00
* resolv/tst-aton.c: Add testcase for IP with four points.
* resolv/inet_addr.c: Don't recognize an IP with four points. Patch by Andre' Breiler <A.Breiler@gmx.net>.
This commit is contained in:
parent
1746f2b0a1
commit
82a7bfdb12
@ -183,7 +183,7 @@ __inet_aton(const char *cp, struct in_addr *addr) {
|
|||||||
* a.b.c (with c treated as 16 bits)
|
* a.b.c (with c treated as 16 bits)
|
||||||
* a.b (with b treated as 24 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;
|
goto ret_0;
|
||||||
*pp++ = val;
|
*pp++ = val;
|
||||||
c = *++cp;
|
c = *++cp;
|
||||||
|
@ -39,6 +39,7 @@ static struct tests
|
|||||||
{ "1.2.256.4", 0, 0 },
|
{ "1.2.256.4", 0, 0 },
|
||||||
{ "1.2.3.0x100", 0, 0 },
|
{ "1.2.3.0x100", 0, 0 },
|
||||||
{ "323543357756889", 0, 0 },
|
{ "323543357756889", 0, 0 },
|
||||||
|
{ "10.1.2.3.4", 0, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user