From 497beda397448fa28410462d507916f56e98dc6a Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 23 Aug 2005 03:01:14 +0000 Subject: [PATCH] adjust builtin syntax checks [RT#15268] --- bin/named/builtin.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/named/builtin.c b/bin/named/builtin.c index a8ecde959a..bcfbd48c66 100644 --- a/bin/named/builtin.c +++ b/bin/named/builtin.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: builtin.c,v 1.8 2005/08/18 00:57:26 marka Exp $ */ +/* $Id: builtin.c,v 1.9 2005/08/23 03:01:14 marka Exp $ */ /*! \file * \brief @@ -214,11 +214,15 @@ static isc_result_t builtin_create(const char *zone, int argc, char **argv, void *driverdata, void **dbdata) { + REQUIRE(argc >= 1); + UNUSED(zone); UNUSED(driverdata); - if ((argc != 1 && strcmp(argv[0], "empty") != 0) || - argc != 3) + if (strcmp(argv[0], "empty") == 0) { + if (argc != 3) + return (DNS_R_SYNTAX); + } else if (argc != 1) return (DNS_R_SYNTAX); if (strcmp(argv[0], "version") == 0)