]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fixed two more cases where rndc could dump core on unexpected EOF in rndc.conf
authorAndreas Gustafsson <source@isc.org>
Tue, 3 Jul 2001 01:56:12 +0000 (01:56 +0000)
committerAndreas Gustafsson <source@isc.org>
Tue, 3 Jul 2001 01:56:12 +0000 (01:56 +0000)
lib/dns/config/confndc.c

index a7ed2e365c9d2cbd1e052d221c35b2d81f13c111..57878595a2a55bfe54cd42e0167b633a7c0c6aa4 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: confndc.c,v 1.25.4.4 2001/07/02 17:55:55 bwelling Exp $ */
+/* $Id: confndc.c,v 1.25.4.5 2001/07/03 01:56:12 gson Exp $ */
 
 /*
 **     options {
@@ -930,6 +930,11 @@ parse_options(ndcpcontext *pctx, dns_c_ndcopts_t **opts) {
        while (result == ISC_R_SUCCESS && pctx->currtok != L_RBRACE) {
                option = pctx->currtok;
 
+               if (option == L_END_INPUT) {
+                       parser_error(pctx, ISC_TRUE,
+                                    "unexpected end of input");
+                       return (ISC_R_FAILURE);
+               }
                if (!eat(pctx, pctx->currtok))
                        return (ISC_R_FAILURE);
 
@@ -1024,6 +1029,11 @@ parse_serverstmt(ndcpcontext *pctx, dns_c_ndcserver_t **server) {
        while (pctx->currtok != L_RBRACE) {
                isc_int32_t field = pctx->currtok;
 
+               if (field == L_END_INPUT) {
+                       parser_error(pctx, ISC_TRUE,
+                                    "unexpected end of input");
+                       return (ISC_R_FAILURE);
+               }
                if (!eat(pctx, field)) {
                        result = ISC_R_FAILURE;
                        goto done;