From 841269601c72af740901768ea4732e484ef41df7 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 9 Dec 2024 14:45:38 +1100 Subject: [PATCH] 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. (cherry picked from commit eb78ad20803b28f1a5ede52115ad6bd73cfeb843) --- lib/irs/resconf.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/irs/resconf.c b/lib/irs/resconf.c index 760967f4db..e41bf2ca4e 100644 --- a/lib/irs/resconf.c +++ b/lib/irs/resconf.c @@ -578,9 +578,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) {