From d775887f012c64e6b75bba77f46ca14f64bcfb3b Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 16 Nov 2010 00:41:32 +0000 Subject: [PATCH] cfg_obj_asnetprefix() check that the destinations are non NULL before writing to them --- lib/isccfg/parser.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index 2c9aca1507..d14f28fb5b 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: parser.c,v 1.135 2010/08/11 18:14:20 each Exp $ */ +/* $Id: parser.c,v 1.136 2010/11/16 00:41:32 marka Exp $ */ /*! \file */ @@ -2006,8 +2006,12 @@ cfg_obj_isnetprefix(const cfg_obj_t *obj) { void cfg_obj_asnetprefix(const cfg_obj_t *obj, isc_netaddr_t *netaddr, - unsigned int *prefixlen) { + unsigned int *prefixlen) +{ REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_netprefix); + REQUIRE(netaddr != NULL); + REQUIRE(prefixlen != NULL); + *netaddr = obj->value.netprefix.address; *prefixlen = obj->value.netprefix.prefixlen; }