s4-backupkey: check for talloc failure
authorArvid Requate <requate@univention.de>
Mon, 7 Jul 2014 16:12:47 +0000 (18:12 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 25 Feb 2015 00:08:10 +0000 (01:08 +0100)
Check for talloc_memdup failure for uniqueid.data.

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
source4/rpc_server/backupkey/dcesrv_backupkey.c

index 5abfa87b022bdfd7b4dbe270f5d298afd902f317..4d75b02bae00ffa27a81ad6b2249575fe34e2827 100644 (file)
@@ -836,6 +836,9 @@ static WERROR self_sign_cert(TALLOC_CTX *ctx, hx509_context *hctx, hx509_request
        int ret;
 
        uniqueid.data = talloc_memdup(ctx, guidblob->data, guidblob->length);
+       if (uniqueid.data == NULL) {
+               return WERR_NOMEM;
+       }
        /* uniqueid is a bit string in which each byte represent 1 bit (1 or 0)
         * so as 1 byte is 8 bits we need to provision 8 times more space as in the
         * blob