mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
X.509: Fix error code in x509_cert_parse()
[ Upstream commit4e880168e9] We forgot to set the error code on this path so it could result in returning NULL which leads to a NULL dereference. Fixes:db6c43bd21("crypto: KEYS: convert public key and digsig asym to the akcipher api") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: James Morris <james.l.morris@oracle.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
45be9b7771
commit
4b8fd8db48
@@ -102,6 +102,7 @@ struct x509_certificate *x509_cert_parse(const void *data, size_t datalen)
|
||||
}
|
||||
}
|
||||
|
||||
ret = -ENOMEM;
|
||||
cert->pub->key = kmemdup(ctx->key, ctx->key_size, GFP_KERNEL);
|
||||
if (!cert->pub->key)
|
||||
goto error_decode;
|
||||
|
||||
Reference in New Issue
Block a user