dirmngr: Strip root zone suffix from libdns SRV results.

* dirmngr/dns-stuff.c (getsrv_libdns): Strip trailing dot from the
target.
--

See-also: b200e636ab
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2017-01-08 18:00:38 +01:00
parent 8d774904c8
commit 9fa94aa107
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 4 additions and 0 deletions

View File

@ -1591,6 +1591,10 @@ getsrv_libdns (const char *name, struct srventry **list, unsigned int *r_count)
srv->weight = dsrv.weight;
srv->port = dsrv.port;
mem2str (srv->target, dsrv.target, sizeof srv->target);
/* Libdns appends the root zone part which is problematic for
* most other functions - strip it. */
if (*srv->target && (srv->target)[strlen (srv->target)-1] == '.')
(srv->target)[strlen (srv->target)-1] = 0;
}
*r_count = srvcount;