]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix parsing of unknown directives in resolv.conf
authorMark Andrews <marka@isc.org>
Mon, 9 Dec 2024 03:45:38 +0000 (14:45 +1100)
committerMark Andrews <marka@isc.org>
Tue, 10 Dec 2024 00:49:11 +0000 (00:49 +0000)
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

index 760967f4dbb496bc603cc40eae4becd8ab0dbef2..e41bf2ca4eedab6b3d315f907ca05c2bd36089d6 100644 (file)
@@ -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) {