diff options
author | Florian Weimer <fweimer@redhat.com> | 2017-07-01 00:53:05 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2017-07-03 21:01:42 +0200 |
commit | 3f853f22c87f0b671c0366eb290919719fa56c0e (patch) | |
tree | 23f8835838728d4be3efca524754c1a2f5bb0396 /resolv/res_query.c | |
parent | f30a54b21b83f254533c59ca72ad17af5249c6be (diff) | |
download | glibc-3f853f22c87f0b671c0366eb290919719fa56c0e.tar.gz glibc-3f853f22c87f0b671c0366eb290919719fa56c0e.tar.xz glibc-3f853f22c87f0b671c0366eb290919719fa56c0e.zip |
resolv: Lift domain search list limits [BZ #19569] [BZ #21475]
This change uses the extended resolver state in struct resolv_conf to store the search list. If applications have not patched the _res object directly, this extended search list will be used by the stub resolver during name resolution.
Diffstat (limited to 'resolv/res_query.c')
-rw-r--r-- | resolv/res_query.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/resolv/res_query.c b/resolv/res_query.c index 33249e36f5..ebbe5a6a4e 100644 --- a/resolv/res_query.c +++ b/resolv/res_query.c @@ -326,7 +326,7 @@ __res_context_search (struct resolv_context *ctx, int *nanswerp2, int *resplen2, int *answerp2_malloced) { struct __res_state *statp = ctx->resp; - const char *cp, * const *domain; + const char *cp; HEADER *hp = (HEADER *) answer; char tmp[NS_MAXDNAME]; u_int dots; @@ -392,10 +392,11 @@ __res_context_search (struct resolv_context *ctx, (dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0)) { int done = 0; - for (domain = (const char * const *)statp->dnsrch; - *domain && !done; - domain++) { - const char *dname = domain[0]; + for (size_t domain_index = 0; !done; ++domain_index) { + const char *dname = __resolv_context_search_list + (ctx, domain_index); + if (dname == NULL) + break; searched = 1; /* __res_context_querydoman concatenates name |