about summary refs log tree commit diff
path: root/resolv/getnetnamadr.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-05-09 15:59:18 +0000
committerRoland McGrath <roland@gnu.org>1996-05-09 15:59:18 +0000
commit557072655748be14a747242135f1b34eff9f735f (patch)
tree9ee1bcb428de7c9f205cf093263d207d0b5ebb38 /resolv/getnetnamadr.c
parent782e865067efc414b8dca36d8dd632d621ba94ef (diff)
downloadglibc-557072655748be14a747242135f1b34eff9f735f.tar.gz
glibc-557072655748be14a747242135f1b34eff9f735f.tar.xz
glibc-557072655748be14a747242135f1b34eff9f735f.zip
* resolv: Code updated from BIND-4.9.3P2C3.
Diffstat (limited to 'resolv/getnetnamadr.c')
-rw-r--r--resolv/getnetnamadr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/resolv/getnetnamadr.c b/resolv/getnetnamadr.c
index b2c911844e..fad2b8c0cd 100644
--- a/resolv/getnetnamadr.c
+++ b/resolv/getnetnamadr.c
@@ -139,7 +139,7 @@ static	char *net_aliases[MAXALIASES], netbuf[BUFSIZ+1];
 	haveanswer = 0;
 	while (--ancount >= 0 && cp < eom) {
 		n = dn_expand(answer->buf, eom, cp, bp, buflen);
-		if (n < 0)
+		if ((n < 0) || !dn_isvalid(bp))
 			break;
 		cp += n;
 		ans[0] = '\0';
@@ -150,7 +150,7 @@ static	char *net_aliases[MAXALIASES], netbuf[BUFSIZ+1];
 		GETSHORT(n, cp);
 		if (class == C_IN && type == T_PTR) {
 			n = dn_expand(answer->buf, eom, cp, bp, buflen);
-			if (n < 0) {
+			if ((n < 0) || !res_hnok(bp)) {
 				cp += n;
 				return (NULL);
 			}
@@ -202,7 +202,7 @@ static	char *net_aliases[MAXALIASES], netbuf[BUFSIZ+1];
 
 struct netent *
 getnetbyaddr(net, net_type)
-	register long net;
+	register u_long net;
 	register int net_type;
 {
 	unsigned int netbr[4];