aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2014-10-15 03:52:43 -0300
committerAlexandre Oliva <aoliva@redhat.com>2014-11-07 07:18:53 -0200
commitba878d017e6b65f5d2880ac8262bc68224ee3a53 (patch)
tree88433eeb33878ef1d153227185387ce1a5607e11
parentff9a1b7dce77c43235e11cda103698078cf44a45 (diff)
don't drop trailing dot in res_nquerydomain(..., name, NULL, ...)
If we drop it here, we will fail to detect a duplicate trailing dot later on. Retaining, OTOH, has no ill effects whatsoever, and it even saves us the trouble of copying the domain name minus the trailing dot, like we used to do. for ChangeLog PR 16469 * resolv/res_query.c (__libc_res_nquerydomain): Retain trailing dot. * NEWS: Fixes 16469.
-rw-r--r--NEWS4
-rw-r--r--resolv/res_query.c10
2 files changed, 3 insertions, 11 deletions
diff --git a/NEWS b/NEWS
index 382d38dbdf..9c664a91ea 100644
--- a/NEWS
+++ b/NEWS
@@ -9,8 +9,8 @@ Version 2.21
* The following bugs are resolved with this release:
- 6652, 12926, 14138, 14171, 15215, 15884, 17266, 17344, 17363, 17370,
- 17371, 17411, 17460, 17485, 17501, 17508, 17522.
+ 6652, 12926, 14138, 14171, 15215, 15884, 16649, 17266, 17344, 17363,
+ 17370, 17371, 17411, 17460, 17485, 17501, 17508, 17522.
Version 2.20
diff --git a/resolv/res_query.c b/resolv/res_query.c
index e4ee2a6005..338ad82411 100644
--- a/resolv/res_query.c
+++ b/resolv/res_query.c
@@ -561,10 +561,6 @@ __libc_res_nquerydomain(res_state statp,
name, domain?domain:"<Nil>", class, type);
#endif
if (domain == NULL) {
- /*
- * Check for trailing '.';
- * copy without '.' if present.
- */
n = strlen(name);
/* Decrement N prior to checking it against MAXDNAME
@@ -575,11 +571,7 @@ __libc_res_nquerydomain(res_state statp,
RES_SET_H_ERRNO(statp, NO_RECOVERY);
return (-1);
}
- if (name[n] == '.') {
- strncpy(nbuf, name, n);
- nbuf[n] = '\0';
- } else
- longname = name;
+ longname = name;
} else {
n = strlen(name);
d = strlen(domain);