Merge branch '4066-resolv-conf-parsing-eats-lines-if-more-than-3-nameservers-set-bind-9.18' into 'bind-9.18'

[9.18] Resolve "resolv.conf parsing eats lines if more than 3 nameservers set"

See merge request isc-projects/bind9!7933
This commit is contained in:
Mark Andrews 2023-05-16 04:05:58 +00:00
commit 50c30d835c
2 changed files with 8 additions and 4 deletions

View file

@ -1,3 +1,7 @@
6173. [bug] Properly process extra "nameserver" lines in
resolv.conf otherwise the next line is not properly
processed. [GL #4066]
6169. [bug] named could crash when deleting inline-signing zones
with "rndc delzone". [GL #4054]

View file

@ -290,10 +290,6 @@ resconf_parsenameserver(irs_resconf_t *conf, FILE *fp) {
int cp;
isc_result_t result;
if (conf->numns == RESCONFMAXNAMESERVERS) {
return (ISC_R_SUCCESS);
}
cp = getword(fp, word, sizeof(word));
if (strlen(word) == 0U) {
return (ISC_R_UNEXPECTEDEND); /* Nothing on line. */
@ -305,6 +301,10 @@ resconf_parsenameserver(irs_resconf_t *conf, FILE *fp) {
return (ISC_R_UNEXPECTEDTOKEN); /* Extra junk on line. */
}
if (conf->numns == RESCONFMAXNAMESERVERS) {
return (ISC_R_SUCCESS);
}
result = add_server(conf->mctx, word, &conf->nameservers);
if (result != ISC_R_SUCCESS) {
return (result);