mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 13:20:00 -04:00
Fixed 39 cases where either named or rndc would crash when
given empty string values in rndc.conf or on the command line
This commit is contained in:
parent
ce1269825c
commit
3a5cbb3c22
11 changed files with 12 additions and 55 deletions
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: confacl.c,v 1.22 2001/01/09 21:51:51 bwelling Exp $ */
|
||||
/* $Id: confacl.c,v 1.23 2001/01/22 03:59:09 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -144,7 +144,6 @@ dns_c_acltable_getacl(dns_c_acltable_t *table,
|
|||
REQUIRE(DNS_C_CONFACLTABLE_VALID(table));
|
||||
REQUIRE(retval != NULL);
|
||||
REQUIRE(aclname != NULL);
|
||||
REQUIRE(*aclname != '\0');
|
||||
|
||||
elem = ISC_LIST_HEAD(table->acl_list);
|
||||
while (elem != NULL) {
|
||||
|
|
@ -196,7 +195,6 @@ dns_c_acl_new(dns_c_acltable_t *table, const char *aclname,
|
|||
|
||||
REQUIRE(DNS_C_CONFACLTABLE_VALID(table));
|
||||
REQUIRE(aclname != NULL);
|
||||
REQUIRE(*aclname != '\0');
|
||||
REQUIRE(newacl != NULL);
|
||||
|
||||
acl = isc_mem_get(table->mem, sizeof *acl);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: confcommon.c,v 1.36 2001/01/09 21:51:53 bwelling Exp $ */
|
||||
/* $Id: confcommon.c,v 1.37 2001/01/22 03:59:11 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -748,7 +748,6 @@ dns_c_charptoname(isc_mem_t *mem, const char *keyval, dns_name_t **name) {
|
|||
unsigned int len;
|
||||
|
||||
REQUIRE(keyval != NULL);
|
||||
REQUIRE(*keyval != '\0');
|
||||
REQUIRE(name != NULL);
|
||||
|
||||
len = strlen(keyval);
|
||||
|
|
@ -853,8 +852,7 @@ isc_result_t
|
|||
dns_c_checkcategory(const char *name) {
|
||||
unsigned int i;
|
||||
|
||||
REQUIRE (name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
REQUIRE(name != NULL);
|
||||
|
||||
/*
|
||||
* This function isn't called very often, so no need for fancy
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: confctx.c,v 1.115 2001/01/09 21:51:55 bwelling Exp $ */
|
||||
/* $Id: confctx.c,v 1.116 2001/01/22 03:59:12 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -179,7 +179,6 @@ PVT_CONCAT(dns_c_ctx_set, FUNC)(dns_c_ctx_t *cfg, const char *newval) \
|
|||
\
|
||||
REQUIRE(DNS_C_CONFCTX_VALID(cfg)); \
|
||||
REQUIRE(newval != NULL); \
|
||||
REQUIRE(*newval != '\0'); \
|
||||
\
|
||||
res = make_options(cfg); \
|
||||
if (res != ISC_R_SUCCESS) { \
|
||||
|
|
@ -1464,7 +1463,6 @@ dns_c_ctx_channeldefinedp(dns_c_ctx_t *cfg, const char *name)
|
|||
|
||||
REQUIRE(DNS_C_CONFCTX_VALID(cfg));
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
|
||||
res = dns_c_logginglist_chanbyname(cfg->logging, name, &chan);
|
||||
|
||||
|
|
@ -2613,7 +2611,6 @@ dns_c_ctx_keydefinedp(dns_c_ctx_t *cfg, const char *keyname)
|
|||
|
||||
REQUIRE(DNS_C_CONFCTX_VALID(cfg));
|
||||
REQUIRE(keyname != NULL);
|
||||
REQUIRE(*keyname != '\0');
|
||||
|
||||
if (cfg->keydefs != NULL) {
|
||||
res = dns_c_kdeflist_find(cfg->keydefs, keyname, &keyid);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: confip.c,v 1.39 2001/01/09 21:51:57 bwelling Exp $ */
|
||||
/* $Id: confip.c,v 1.40 2001/01/22 03:59:13 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -408,7 +408,6 @@ dns_c_ipmatch_aclnew(isc_mem_t *mem,
|
|||
REQUIRE(result != NULL);
|
||||
REQUIRE(mem != NULL);
|
||||
REQUIRE(aclname != NULL);
|
||||
REQUIRE(*aclname != '\0');
|
||||
|
||||
*result = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: confkeys.c,v 1.31 2001/01/09 21:51:58 bwelling Exp $ */
|
||||
/* $Id: confkeys.c,v 1.32 2001/01/22 03:59:14 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -152,7 +152,6 @@ dns_c_kdeflist_undef(dns_c_kdeflist_t *list, const char *keyid)
|
|||
|
||||
REQUIRE(DNS_C_KDEFLIST_VALID(list));
|
||||
REQUIRE(keyid != NULL);
|
||||
REQUIRE(*keyid != '\0');
|
||||
|
||||
kd = ISC_LIST_HEAD(list->keydefs);
|
||||
while (kd != NULL) {
|
||||
|
|
@ -183,7 +182,6 @@ dns_c_kdeflist_find(dns_c_kdeflist_t *list, const char *keyid,
|
|||
|
||||
REQUIRE(DNS_C_KDEFLIST_VALID(list));
|
||||
REQUIRE(keyid != NULL);
|
||||
REQUIRE(*keyid != '\0');
|
||||
|
||||
kd = ISC_LIST_HEAD(list->keydefs);
|
||||
while (kd != NULL) {
|
||||
|
|
@ -234,7 +232,6 @@ dns_c_kdef_new(isc_mem_t *mem, const char *name, dns_c_kdef_t **keyid)
|
|||
|
||||
REQUIRE(keyid != NULL);
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
|
||||
kd = isc_mem_get(mem, sizeof *kd);
|
||||
if (kd == NULL) {
|
||||
|
|
@ -363,7 +360,6 @@ dns_c_kdef_setalgorithm(dns_c_kdef_t *keydef, const char *algorithm)
|
|||
{
|
||||
REQUIRE(DNS_C_KDEF_VALID(keydef));
|
||||
REQUIRE(algorithm != NULL);
|
||||
REQUIRE(*algorithm != '\0');
|
||||
|
||||
if (keydef->algorithm != NULL) {
|
||||
isc_mem_free(keydef->mem, keydef->algorithm);
|
||||
|
|
@ -383,7 +379,6 @@ dns_c_kdef_setsecret(dns_c_kdef_t *keydef, const char *secret)
|
|||
{
|
||||
REQUIRE(DNS_C_KDEF_VALID(keydef));
|
||||
REQUIRE(secret != NULL);
|
||||
REQUIRE(*secret != '\0');
|
||||
|
||||
if (keydef->secret != NULL) {
|
||||
isc_mem_free(keydef->mem, keydef->secret);
|
||||
|
|
@ -501,7 +496,6 @@ dns_c_kidlist_undef(dns_c_kidlist_t *list, const char *keyid)
|
|||
|
||||
REQUIRE(DNS_C_KEYIDLIST_VALID(list));
|
||||
REQUIRE(keyid != NULL);
|
||||
REQUIRE(*keyid != '\0');
|
||||
|
||||
dns_c_kidlist_find(list, keyid, &ki);
|
||||
|
||||
|
|
@ -524,7 +518,6 @@ dns_c_kidlist_find(dns_c_kidlist_t *list, const char *keyid,
|
|||
|
||||
REQUIRE(DNS_C_KEYIDLIST_VALID(list));
|
||||
REQUIRE(keyid != NULL);
|
||||
REQUIRE(*keyid != '\0');
|
||||
REQUIRE(retval != NULL);
|
||||
|
||||
iter = ISC_LIST_HEAD(list->keyids);
|
||||
|
|
@ -590,7 +583,6 @@ dns_c_kid_new(isc_mem_t *mem, const char *name, dns_c_kid_t **keyid)
|
|||
dns_c_kid_t *ki;
|
||||
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
REQUIRE(keyid != NULL);
|
||||
|
||||
ki = isc_mem_get(mem, sizeof *ki);
|
||||
|
|
@ -760,7 +752,6 @@ dns_c_pklist_rmpubkey(dns_c_pklist_t *list,
|
|||
|
||||
REQUIRE(DNS_C_PKLIST_VALID(list));
|
||||
REQUIRE(key != NULL);
|
||||
REQUIRE(*key != '\0');
|
||||
|
||||
r = dns_c_pklist_findpubkey(list, &pk, flags, protocol,
|
||||
algorithm, key);
|
||||
|
|
@ -784,7 +775,6 @@ dns_c_pubkey_new(isc_mem_t *mem, isc_uint32_t flags,
|
|||
|
||||
REQUIRE(pubkey != NULL);
|
||||
REQUIRE(key != NULL);
|
||||
REQUIRE(*key != '\0');
|
||||
|
||||
pkey = isc_mem_get(mem, sizeof *pkey);
|
||||
if (pkey == NULL) {
|
||||
|
|
@ -1032,9 +1022,7 @@ dns_c_tkey_new(isc_mem_t *mem, const char *domain, isc_uint32_t flags,
|
|||
isc_result_t res;
|
||||
|
||||
REQUIRE(domain != NULL);
|
||||
REQUIRE(*domain != '\0');
|
||||
REQUIRE(key != NULL);
|
||||
REQUIRE(*key != '\0');
|
||||
REQUIRE(newkey != NULL);
|
||||
|
||||
newk = isc_mem_get(mem, sizeof *newk);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: conflog.c,v 1.20 2001/01/09 21:51:59 bwelling Exp $ */
|
||||
/* $Id: conflog.c,v 1.21 2001/01/22 03:59:15 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -341,7 +341,6 @@ dns_c_logginglist_delchannel(dns_c_logginglist_t *list,
|
|||
|
||||
REQUIRE(DNS_C_LOGLIST_VALID(list));
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
|
||||
res = dns_c_logginglist_chanbyname(list, name, &logc);
|
||||
if (res == ISC_R_SUCCESS) {
|
||||
|
|
@ -363,7 +362,6 @@ dns_c_logginglist_delcategory(dns_c_logginglist_t *list,
|
|||
|
||||
REQUIRE(DNS_C_LOGLIST_VALID(list));
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
|
||||
res = dns_c_logginglist_catbyname(list, name, &logc);
|
||||
if (res == ISC_R_SUCCESS) {
|
||||
|
|
@ -385,7 +383,6 @@ dns_c_logginglist_chanbyname(dns_c_logginglist_t *list,
|
|||
|
||||
REQUIRE(DNS_C_LOGLIST_VALID(list));
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
REQUIRE(chan != NULL);
|
||||
|
||||
logc = ISC_LIST_HEAD(list->channels);
|
||||
|
|
@ -415,7 +412,6 @@ dns_c_logginglist_catbyname(dns_c_logginglist_t *list,
|
|||
|
||||
REQUIRE(DNS_C_LOGLIST_VALID(list));
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
REQUIRE(cat != NULL);
|
||||
|
||||
logc = ISC_LIST_HEAD(list->categories);
|
||||
|
|
@ -480,7 +476,6 @@ dns_c_logchan_new(isc_mem_t *mem, const char *name,
|
|||
dns_c_logchan_t *newc;
|
||||
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
REQUIRE(newchan != NULL);
|
||||
|
||||
newc = isc_mem_get(mem, sizeof *newc);
|
||||
|
|
@ -693,7 +688,6 @@ dns_c_logchan_setpath(dns_c_logchan_t *channel, const char *path) {
|
|||
|
||||
REQUIRE(DNS_C_LOGCHAN_VALID(channel));
|
||||
REQUIRE(path != NULL);
|
||||
REQUIRE(*path != '\0');
|
||||
|
||||
if (channel->ctype != dns_c_logchan_file) {
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_CONFIG,
|
||||
|
|
@ -1209,7 +1203,6 @@ dns_c_logcat_addname(dns_c_logcat_t *logcat, const char *name) {
|
|||
|
||||
REQUIRE(DNS_C_LOGCAT_VALID(logcat));
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
|
||||
if (logcat->cnames_len == logcat->nextcname) {
|
||||
size_t newsize = logcat->cnames_len + 5;
|
||||
|
|
@ -1254,7 +1247,6 @@ dns_c_logcat_delname(dns_c_logcat_t *logcat, const char *name) {
|
|||
|
||||
REQUIRE(DNS_C_LOGCAT_VALID(logcat));
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
|
||||
for (i = 0 ; i < logcat->nextcname ; i++) {
|
||||
INSIST(logcat->channel_names[i] != NULL);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: conflwres.c,v 1.7 2001/01/09 21:52:01 bwelling Exp $ */
|
||||
/* $Id: conflwres.c,v 1.8 2001/01/22 03:59:16 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -401,7 +401,6 @@ dns_c_search_new(isc_mem_t *mem, const char *val, dns_c_search_t **search)
|
|||
dns_c_search_t *ki;
|
||||
|
||||
REQUIRE(val != NULL);
|
||||
REQUIRE(*val != '\0');
|
||||
REQUIRE(search != NULL);
|
||||
|
||||
ki = isc_mem_get(mem, sizeof *ki);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: confndc.c,v 1.27 2001/01/09 21:52:02 bwelling Exp $ */
|
||||
/* $Id: confndc.c,v 1.28 2001/01/22 03:59:18 gson Exp $ */
|
||||
|
||||
/*
|
||||
** options {
|
||||
|
|
@ -575,7 +575,6 @@ dns_c_ndcopts_setdefserver(dns_c_ndcopts_t *opts, const char *newval) {
|
|||
isc_boolean_t existed;
|
||||
|
||||
REQUIRE(DNS_C_NDCOPTIONS_VALID(opts));
|
||||
REQUIRE(newval == NULL || *newval != '\0');
|
||||
|
||||
existed = ISC_TF(opts->defserver != NULL);
|
||||
|
||||
|
|
@ -598,7 +597,6 @@ dns_c_ndcopts_setdefkey(dns_c_ndcopts_t *opts, const char *newval) {
|
|||
isc_boolean_t existed;
|
||||
|
||||
REQUIRE(DNS_C_NDCOPTIONS_VALID(opts));
|
||||
REQUIRE(newval == NULL || *newval != '\0');
|
||||
|
||||
existed = ISC_TF(opts->defkey != NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: confparser.y.dirty,v 1.49 2001/01/16 13:39:42 marka Exp $ */
|
||||
/* $Id: confparser.y.dirty,v 1.50 2001/01/22 03:59:19 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -6410,7 +6410,6 @@ dns_c_parse_namedconf(const char *filename, isc_mem_t *mem,
|
|||
|
||||
REQUIRE(currcfg == NULL);
|
||||
REQUIRE(filename != NULL);
|
||||
REQUIRE(*filename != '\0');
|
||||
REQUIRE(configctx != NULL);
|
||||
INSIST(mylexer == NULL);
|
||||
INSIST(memctx == NULL);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: confview.c,v 1.69 2001/01/18 19:01:39 gson Exp $ */
|
||||
/* $Id: confview.c,v 1.70 2001/01/22 03:59:20 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -220,7 +220,6 @@ PVT_CONCAT(dns_c_view_set, FUNC)(dns_c_view_t *view, const char *newval) \
|
|||
\
|
||||
REQUIRE(DNS_C_VIEW_VALID(view)); \
|
||||
REQUIRE(newval != NULL); \
|
||||
REQUIRE(*newval != '\0'); \
|
||||
\
|
||||
if (newval != NULL) { \
|
||||
p = isc_mem_strdup(view->mem, newval); \
|
||||
|
|
@ -395,7 +394,6 @@ dns_c_viewtable_viewbyname(dns_c_viewtable_t *viewtable,
|
|||
REQUIRE(DNS_C_VIEWTABLE_VALID(viewtable));
|
||||
REQUIRE(retval != NULL);
|
||||
REQUIRE(viewname != NULL);
|
||||
REQUIRE(*viewname != '\0');
|
||||
|
||||
elem = ISC_LIST_HEAD(viewtable->views);
|
||||
while (elem != NULL) {
|
||||
|
|
@ -503,7 +501,6 @@ dns_c_view_new(isc_mem_t *mem, const char *name, dns_rdataclass_t viewclass,
|
|||
dns_c_view_t *view;
|
||||
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
REQUIRE(newview != NULL);
|
||||
|
||||
view = isc_mem_get(mem, sizeof *view);
|
||||
|
|
@ -1034,7 +1031,6 @@ dns_c_view_keydefinedp(dns_c_view_t *view, const char *keyname) {
|
|||
|
||||
REQUIRE(DNS_C_VIEW_VALID(view));
|
||||
REQUIRE(keyname != NULL);
|
||||
REQUIRE(*keyname != '\0');
|
||||
|
||||
if (view->keydefs != NULL) {
|
||||
res = dns_c_kdeflist_find(view->keydefs, keyname, &keyid);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: confzone.c,v 1.74 2001/01/09 23:42:51 bwelling Exp $ */
|
||||
/* $Id: confzone.c,v 1.75 2001/01/22 03:59:21 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -267,7 +267,6 @@ dns_c_zonelist_find(dns_c_zonelist_t *zlist, const char *name,
|
|||
|
||||
REQUIRE(DNS_C_ZONELIST_VALID(zlist));
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
REQUIRE(retval != NULL);
|
||||
|
||||
zoneelem = ISC_LIST_HEAD(zlist->zones);
|
||||
|
|
@ -296,7 +295,6 @@ dns_c_zonelist_rmbyname(dns_c_zonelist_t *zlist, const char *name) {
|
|||
|
||||
REQUIRE(DNS_C_ZONELIST_VALID(zlist));
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
|
||||
zoneelem = ISC_LIST_HEAD(zlist->zones);
|
||||
while (zoneelem != NULL) {
|
||||
|
|
@ -454,7 +452,6 @@ dns_c_zone_new(isc_mem_t *mem,
|
|||
|
||||
REQUIRE(mem != NULL);
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(*name != '\0');
|
||||
|
||||
newzone = isc_mem_get(mem, sizeof *newzone);
|
||||
if (newzone == NULL) {
|
||||
|
|
@ -818,7 +815,6 @@ dns_c_zone_setfile(dns_c_zone_t *zone, const char *newfile) {
|
|||
|
||||
REQUIRE(DNS_C_ZONE_VALID(zone));
|
||||
REQUIRE(newfile != NULL);
|
||||
REQUIRE(*newfile != '\0');
|
||||
|
||||
switch (zone->ztype) {
|
||||
case dns_c_zone_master:
|
||||
|
|
@ -2212,7 +2208,6 @@ dns_c_zone_setixfrbase(dns_c_zone_t *zone, const char *newval) {
|
|||
|
||||
REQUIRE(DNS_C_ZONE_VALID(zone));
|
||||
REQUIRE(newval != NULL);
|
||||
REQUIRE(*newval != '\0');
|
||||
|
||||
switch (zone->ztype) {
|
||||
case dns_c_zone_master:
|
||||
|
|
@ -2320,7 +2315,6 @@ dns_c_zone_setixfrtmp(dns_c_zone_t *zone, const char *newval) {
|
|||
|
||||
REQUIRE(DNS_C_ZONE_VALID(zone));
|
||||
REQUIRE(newval != NULL);
|
||||
REQUIRE(*newval != '\0');
|
||||
|
||||
switch (zone->ztype) {
|
||||
case dns_c_zone_master:
|
||||
|
|
@ -4656,7 +4650,6 @@ dns_c_zone_setdatabase(dns_c_zone_t *zone, const char *database)
|
|||
|
||||
REQUIRE(DNS_C_ZONE_VALID(zone));
|
||||
REQUIRE(database != NULL);
|
||||
REQUIRE(database[0] != '\0');
|
||||
|
||||
if (zone->database != NULL) {
|
||||
existed = ISC_TRUE;
|
||||
|
|
|
|||
Loading…
Reference in a new issue