From 59c6f0e26b76c48a0628513ee98ccbd1bbc50132 Mon Sep 17 00:00:00 2001 From: James Brister Date: Fri, 15 Oct 1999 19:04:38 +0000 Subject: [PATCH] If logging context is NULL in isc_log_vwrite(), then bail before doing any REQUIREs that require it being non-NULL. --- lib/isc/log.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/isc/log.c b/lib/isc/log.c index 4396ba0b74..f3e2f58497 100644 --- a/lib/isc/log.c +++ b/lib/isc/log.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: log.c,v 1.6 1999/10/11 16:10:06 tale Exp $ */ +/* $Id: log.c,v 1.7 1999/10/15 19:04:38 brister Exp $ */ /* Principal Authors: DCL */ @@ -756,10 +756,6 @@ isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category, isc_result_t result; REQUIRE(lctx == NULL || VALID_CONTEXT(lctx)); - REQUIRE(category != NULL && category->id < lctx->category_count); - REQUIRE(module != NULL && module->id < lctx->module_count); - REQUIRE(level != ISC_LOG_DYNAMIC); - REQUIRE(format != NULL); /* * Programs can use libraries that use this logging code without @@ -769,6 +765,11 @@ isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category, if (lctx == NULL) return; + REQUIRE(category != NULL && category->id < lctx->category_count); + REQUIRE(module != NULL && module->id < lctx->module_count); + REQUIRE(level != ISC_LOG_DYNAMIC); + REQUIRE(format != NULL); + time_string[0] = '\0'; level_string[0] = '\0'; lctx->buffer[0] = '\0';