mirror of git://git.gnupg.org/gnupg.git
dirmngr: Improve error handling.
* dirmngr/dns-stuff.c (getsrv): Avoid looking at 'header' before
checking for errors, but silently ignore errors when looking up SRV
records.
--
This is a follow-up to 946faaff
.
Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
9f4f77bc4b
commit
9c34711539
|
@ -1086,10 +1086,9 @@ getsrv (const char *name,struct srventry **list)
|
|||
return -1;
|
||||
|
||||
r = res_query (name, C_IN, T_SRV, answer, sizeof answer);
|
||||
if (header->rcode != NOERROR || !(count=ntohs (header->ancount)))
|
||||
if (r < sizeof (HEADER) || r > sizeof answer
|
||||
|| 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)];
|
||||
|
|
Loading…
Reference in New Issue