summaryrefslogtreecommitdiffstats
path: root/lib/libc/asr/res_init.c
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2015-11-05 23:59:47 +0000
committerbluhm <bluhm@openbsd.org>2015-11-05 23:59:47 +0000
commitd0bb122bd699d1bc370b19a711dc1a5a5594920b (patch)
tree0ea09ce3bcd76c71b59eedfce8ade317640c994e /lib/libc/asr/res_init.c
parentThese NDINIT run out of the context of the process doing execve, (diff)
downloadwireguard-openbsd-d0bb122bd699d1bc370b19a711dc1a5a5594920b.tar.xz
wireguard-openbsd-d0bb122bd699d1bc370b19a711dc1a5a5594920b.zip
Set the name server counter in __res_state correctly if a nameserver
from asr_ctx was skiped. Missed in previous commit. OK deraadt@
Diffstat (limited to 'lib/libc/asr/res_init.c')
-rw-r--r--lib/libc/asr/res_init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/asr/res_init.c b/lib/libc/asr/res_init.c
index 52705658fda..f6cb36ad40a 100644
--- a/lib/libc/asr/res_init.c
+++ b/lib/libc/asr/res_init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_init.c,v 1.7 2015/11/05 22:44:37 bluhm Exp $ */
+/* $OpenBSD: res_init.c,v 1.8 2015/11/05 23:59:47 bluhm Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -57,7 +57,6 @@ res_init(void)
if (_res.lookups[0] == '\0')
strlcpy(_res.lookups, ac->ac_db, sizeof(_res.lookups));
- _res.nscount = ac->ac_nscount;
for (i = 0, j = 0; i < ac->ac_nscount && j < MAXNS; i++) {
if (ac->ac_ns[i]->sa_family != AF_INET ||
ac->ac_ns[i]->sa_len > sizeof(_res.nsaddr_list[j]))
@@ -66,6 +65,7 @@ res_init(void)
ac->ac_ns[i]->sa_len);
j++;
}
+ _res.nscount = j;
_res.options |= RES_INIT;
}
_THREAD_PRIVATE_MUTEX_UNLOCK(init);