aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2015-11-23 14:46:33 +0000
committerJustus Winter <[email protected]>2015-11-23 14:52:50 +0000
commit946faaff04f3340ed6db9e89c5036dc5f9beca6a (patch)
tree9855889f9931a56ebf94288fabf919541e950d6a
parentdirmngr: Honor ports specified in SRV records. (diff)
downloadgnupg-946faaff04f3340ed6db9e89c5036dc5f9beca6a.tar.gz
gnupg-946faaff04f3340ed6db9e89c5036dc5f9beca6a.zip
dirmngr: Fix SRV record lookups when using the system resolver.
* dirmngr/dns-stuff.c (getsrv): Fix error handling. -- This fixes hkp server pools not using SRV records. Signed-off-by: Justus Winter <[email protected]>
-rw-r--r--dirmngr/dns-stuff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
index 2af4dec1c..694c04b6c 100644
--- a/dirmngr/dns-stuff.c
+++ b/dirmngr/dns-stuff.c
@@ -1086,10 +1086,10 @@ getsrv (const char *name,struct srventry **list)
return -1;
r = res_query (name, C_IN, T_SRV, answer, sizeof answer);
- if (r < sizeof (HEADER) || r > sizeof answer)
- return -1;
if (header->rcode != NOERROR || !(count=ntohs (header->ancount)))
return 0; /* Error or no record found. */
+ if (r < sizeof (HEADER) || r > sizeof answer)
+ return -1;
emsg = &answer[r];
pt = &answer[sizeof(HEADER)];