3027. [bug] Add documented REQUIREs to cfg_obj_asnetprefix() to

catch NULL pointer dereferences before they happen.
                        [RT #22521]
This commit is contained in:
Mark Andrews
2011-02-21 06:13:58 +00:00
parent 5a70082ce7
commit 1636fe17c3
2 changed files with 10 additions and 2 deletions

View File

@@ -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]

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: parser.c,v 1.129 2008/09/25 04:02:39 tbox Exp $ */
/* $Id: parser.c,v 1.129.48.1 2011/02/21 06:13:58 marka Exp $ */
/*! \file */
@@ -1977,8 +1977,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;
}