This should be hard to trigger, but goto fail is always nicer than sig 11.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
/* Add all names in the result in a tree */
for (i=0; i<res->count; i++) {
ptr = ldb_msg_find_attr_as_string(res->msgs[i], "name", NULL);
+ if (ptr == NULL) {
+ DBG_ERR("dnsserver: dns record has no name (%s)",
+ ldb_dn_get_linearized(res->msgs[i]->dn));
+ goto failed;
+ }
if (strcmp(ptr, "@") == 0) {
base->data = res->msgs[i];