Fix parsing of unknown directives in resolv.conf

Only call eatline() to skip to the next line if we're not
already at the end of a line when parsing an unknown directive.
We were accidentally skipping the next line when there was only
a single unknown directive on the current line.
This commit is contained in:
Mark Andrews 2024-12-09 14:45:38 +11:00 committed by Evan Hunt
parent 713357456f
commit eb78ad2080

View file

@ -585,9 +585,11 @@ irs_resconf_load(isc_mem_t *mctx, const char *filename, irs_resconf_t **confp) {
} else {
/* unrecognised word. Ignore entire line */
rval = ISC_R_SUCCESS;
stopchar = eatline(fp);
if (stopchar == EOF) {
break;
if (stopchar != '\n') {
stopchar = eatline(fp);
if (stopchar == EOF) {
break;
}
}
}
if (ret == ISC_R_SUCCESS && rval != ISC_R_SUCCESS) {