From: Volker Lendecke Date: Thu, 31 May 2018 19:16:21 +0000 (+0200) Subject: dns: Check for talloc_memdup failure X-Git-Tag: tevent-0.9.37~433 X-Git-Url: http://git.samba.org/samba.git/?p=kai%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=c56cd283f5796ea22e2cceb0d058473b8fe299fd dns: Check for talloc_memdup failure Signed-off-by: Volker Lendecke Reviewed-by: Andreas Schneider Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Fri Jun 1 14:05:56 CEST 2018 on sn-devel-144 --- diff --git a/source4/dns_server/dns_query.c b/source4/dns_server/dns_query.c index dfcba6e094a..923f7233eb9 100644 --- a/source4/dns_server/dns_query.c +++ b/source4/dns_server/dns_query.c @@ -869,6 +869,9 @@ static WERROR handle_tkey(struct dns_server *dns, ret_tkey->rdata.tkey_record.key_data = talloc_memdup(ret_tkey, reply.data, reply.length); + if (ret_tkey->rdata.tkey_record.key_data == NULL) { + return WERR_NOT_ENOUGH_MEMORY; + } state->sign = true; state->key_name = talloc_strdup(state->mem_ctx, tkey->name); if (state->key_name == NULL) {