mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
dns: Make reading resolv.conf more robust.
* dirmngr/dns.c (dns_resconf_loadfile): Skip "search" which begins with '.'. -- GnuPG-bug-id: 5657 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
918e921800
commit
152f028155
1 changed files with 6 additions and 1 deletions
|
@ -5659,7 +5659,12 @@ skip:
|
||||||
memset(resconf->search, '\0', sizeof resconf->search);
|
memset(resconf->search, '\0', sizeof resconf->search);
|
||||||
|
|
||||||
for (i = 1, j = 0; i < wc && j < lengthof(resconf->search); i++, j++)
|
for (i = 1, j = 0; i < wc && j < lengthof(resconf->search); i++, j++)
|
||||||
|
if (words[i][0] == '.') {
|
||||||
|
/* Ignore invalid search spec. */
|
||||||
|
j--;
|
||||||
|
} else {
|
||||||
dns_d_anchor(resconf->search[j], sizeof resconf->search[j], words[i], strlen(words[i]));
|
dns_d_anchor(resconf->search[j], sizeof resconf->search[j], words[i], strlen(words[i]));
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case DNS_RESCONF_LOOKUP:
|
case DNS_RESCONF_LOOKUP:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue