dns: Check for talloc_memdup failure
authorVolker Lendecke <vl@samba.org>
Thu, 31 May 2018 19:16:21 +0000 (21:16 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 1 Jun 2018 12:05:56 +0000 (14:05 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jun  1 14:05:56 CEST 2018 on sn-devel-144

source4/dns_server/dns_query.c

index dfcba6e094adb64f09c7e5feba5127a7611e31b9..923f7233eb995baaa524621567a75e981a0f32c5 100644 (file)
@@ -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) {