]> git.saurik.com Git - apple/libc.git/blame - net/FreeBSD/inet_net_pton.c.patch
Libc-498.1.5.tar.gz
[apple/libc.git] / net / FreeBSD / inet_net_pton.c.patch
CommitLineData
b5d655f7
A
1--- inet_net_pton.c.orig 2008-09-01 22:59:17.000000000 -0700
2+++ inet_net_pton.c 2008-09-01 23:00:34.000000000 -0700
3@@ -18,6 +18,10 @@
4 #if defined(LIBC_SCCS) && !defined(lint)
5 static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7.18.1 2005/04/27 05:00:53 sra Exp $";
6 #endif
3d9156a7 7+
b5d655f7
A
8+/* the algorithms only can deal with ASCII, so we optimize for it */
9+#define USE_ASCII
10+
11 #include <sys/cdefs.h>
12 __FBSDID("$FreeBSD: src/lib/libc/inet/inet_net_pton.c,v 1.3 2007/06/03 17:20:26 ume Exp $");
3d9156a7 13
b5d655f7 14@@ -135,11 +139,11 @@ inet_net_pton_ipv4(const char *src, u_ch
3d9156a7
A
15 assert(n >= 0 && n <= 9);
16 bits *= 10;
17 bits += n;
b5d655f7
A
18+ if (bits > 32)
19+ goto emsgsize;
20 } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
3d9156a7
A
21 if (ch != '\0')
22 goto enoent;
b5d655f7
A
23- if (bits > 32)
24- goto emsgsize;
25 }
26
27 /* Firey death and destruction unless we prefetched EOS. */