summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2019-05-03 10:10:01 +1200
committerDouglas Bagnall <dbagnall@samba.org>2019-05-09 22:39:27 +0000
commit74cd11df838815dbef2a505e58c2cb863a82be97 (patch)
tree80cc391963276554b3ce5ce8c03f46d46c798b0b /source4/rpc_server
parenta9e6300a5d49182f3c05fd3f11cf056015854820 (diff)
downloadsamba-74cd11df838815dbef2a505e58c2cb863a82be97.tar.gz
rpc/dnsdata: avoid crash on missing attr (CID: 1414757)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/dnsserver/dnsdata.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/rpc_server/dnsserver/dnsdata.c b/source4/rpc_server/dnsserver/dnsdata.c
index 6a211ad9efd..415a7c57a0f 100644
--- a/source4/rpc_server/dnsserver/dnsdata.c
+++ b/source4/rpc_server/dnsserver/dnsdata.c
@@ -968,6 +968,12 @@ WERROR dns_fill_records_array(TALLOC_CTX *mem_ctx,
}
ptr = ldb_msg_find_attr_as_string(msg, "name", NULL);
+ if (ptr == NULL) {
+ DBG_ERR("dnsserver: dns record has no name (%s)",
+ ldb_dn_get_linearized(msg->dn));
+ return WERR_INTERNAL_DB_ERROR;
+ }
+
el = ldb_msg_find_element(msg, "dnsRecord");
if (el == NULL || el->values == 0) {
return WERR_OK;