aboutsummaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorDon Lewis <truckman@FreeBSD.org>2016-05-16 01:30:32 +0000
committerDon Lewis <truckman@FreeBSD.org>2016-05-16 01:30:32 +0000
commit0abffcb5f83e67d89f0c3bc6fc38b99284790934 (patch)
treeaa3d077efd1cfd8c811a5cdbe2c6eed92687f780 /lib/libc
parent1dcace5ba0ad6103ef96cd0d60c7403ba96e65ce (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/resolv/res_query.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libc/resolv/res_query.c b/lib/libc/resolv/res_query.c
index db26ef88b713d..9731638a7f29b 100644
--- a/lib/libc/resolv/res_query.c
+++ b/lib/libc/resolv/res_query.c
@@ -135,10 +135,12 @@ again:
if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 &&
(statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID))) {
n = res_nopt(statp, n, buf, sizeof(buf), anslen);
- rdata = &buf[n];
- if (n > 0 && (statp->options & RES_NSID) != 0U) {
- n = res_nopt_rdata(statp, n, buf, sizeof(buf), rdata,
- NS_OPT_NSID, 0, NULL);
+ if (n > 0) {
+ rdata = &buf[n];
+ if ((statp->options & RES_NSID) != 0U) {
+ n = res_nopt_rdata(statp, n, buf, sizeof(buf),
+ rdata, NS_OPT_NSID, 0, NULL);
+ }
}
}
#endif