From: Arvid Requate Date: Mon, 7 Jul 2014 16:12:47 +0000 (+0200) Subject: s4-backupkey: check for talloc failure X-Git-Tag: samba-4.2.0~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c998e9df62b099c0c81711616eac3e311dac34e4;p=thirdparty%2Fsamba.git s4-backupkey: check for talloc failure Check for talloc_memdup failure for uniqueid.data. Signed-off-by: Arvid Requate Reviewed-by: Andrew Bartlett Reviewed-by: Garming Sam (cherry picked from commit d633fcb5666085fef290adbe05161a2f36329abf) --- diff --git a/source4/rpc_server/backupkey/dcesrv_backupkey.c b/source4/rpc_server/backupkey/dcesrv_backupkey.c index 5abfa87b022..4d75b02bae0 100644 --- a/source4/rpc_server/backupkey/dcesrv_backupkey.c +++ b/source4/rpc_server/backupkey/dcesrv_backupkey.c @@ -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