Changes since 4.3.3
+- Fixed several potential null references. Thanks to Bill Parker
+ (wp02855 at gmail dot com) who identified these issues and supplied
+ patches to address them.
+ [ISC-Bugs #40754]
+
- The linux packet fitler code now correctly treats only least significant
12 bits an inbound packet's TCI value as the VLAN id (per IEEE 802.1Q).
Prior to this it was using the entire 16 bit value as the VLAN id and
struct dhc6_addr **insert_addr, *addr;
copy = dmalloc(sizeof(*ia), file, line);
+ if (copy == NULL) {
+ log_error("Out of memory for v6 duplicate IA structure.");
+ return NULL;
+ }
memcpy(copy->iaid, ia->iaid, sizeof(copy->iaid));
*/
ip->address_count = ip->address_max = 1;
ip->addresses = dmalloc(sizeof(*ip->addresses), MDL);
+ if (!ip->addresses) {
+ dfree(ip->ifp, MDL);
+ ip->ifp = NULL;
+ interface_dereference (&ip, MDL);
+ status = ISC_R_NOMEMORY;
+ goto foo;
+ }
memcpy(ip->addresses, &tipkt->primary_address, sizeof(*ip->addresses));
memcpy (ip -> name, tipkt -> name, sizeof ip -> name);
ip -> index = ntohl (tipkt -> index);
log_fatal ("No memory for shared subnet: %s",
isc_result_totext (status));
ip -> shared_network -> name = dmalloc (strlen (fnn) + 1, MDL);
+ if (!ip -> shared_network -> name)
+ log_fatal("no memory for shared network");
strcpy (ip -> shared_network -> name, fnn);
return 1;
}
struct ldap_config_stack *ns;
ns = dmalloc (sizeof (*ns), MDL);
+ if (!ns) {
+ log_fatal ("no memory for add_to_config_stack()");
+ }
+
ns->res = res;
ns->ldent = ent;
ns->close_brace = 0;
status = omapi_get_value_str(ref, id, "name", &nv);
if (status == ISC_R_SUCCESS) {
char *name = dmalloc(nv->value->u.buffer.len + 1, MDL);
+ if (name == NULL)
+ return (ISC_R_NOMEMORY);
memcpy (name,
nv->value->u.buffer.value,
nv->value->u.buffer.len);
Memory allocation for the DHCP server... */
/*
- * Copyright (c) 2009,2012,2014 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2009,2012,2014-2015 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
dfree(c, MDL);
}
}
+
#endif
struct lease *new_leases (n, file, line)
struct lease *rval;
#if defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
rval = dmalloc ((n + 1) * sizeof (struct lease), file, line);
- memset (rval, 0, sizeof (struct lease));
- rval -> starts = n;
- rval -> next = lease_hunks;
- lease_hunks = rval;
- rval++;
+ if (rval != NULL) {
+ memset (rval, 0, sizeof (struct lease));
+ rval -> starts = n;
+ rval -> next = lease_hunks;
+ lease_hunks = rval;
+ rval++;
+ }
#else
rval = dmalloc (n * sizeof (struct lease), file, line);
#endif