]> 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)
committerEvan Hunt <each@isc.org>
Tue, 10 Dec 2024 00:08:06 +0000 (16:08 -0800)
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.

lib/dns/resconf.c

index 47e8e4e66355ccf791543b4583bb3b1187a35662..d1d660e60a31ee416b634ab85a0fce1ea2a3a761 100644 (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) {