diff --git a/CHANGES b/CHANGES index 3368f4c428..05f3e725c0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +3027. [bug] Add documented REQUIREs to cfg_obj_asnetprefix() to + catch NULL pointer dereferences before they happen. + [RT #22521] + 3026. [bug] lib/isc/httpd.c: check that we have enough space after calling grow_headerspace() and if not re-call grow_headerspace() until we do. [RT #22521] diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index 7db753e2cb..70126fc973 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: parser.c,v 1.139 2011/01/04 23:47:14 tbox Exp $ */ +/* $Id: parser.c,v 1.140 2011/02/21 06:07:49 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; }