mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
ssl3_get_certificate_request: check for NULL after allocating s->cert->ctypes
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Matt Caswell <matt@openssl.org>
This commit is contained in:
parent
d00b1d62d6
commit
9052ffda91
@ -2145,6 +2145,11 @@ int ssl3_get_certificate_request(SSL *s)
|
|||||||
{
|
{
|
||||||
/* If we exceed static buffer copy all to cert structure */
|
/* If we exceed static buffer copy all to cert structure */
|
||||||
s->cert->ctypes = OPENSSL_malloc(ctype_num);
|
s->cert->ctypes = OPENSSL_malloc(ctype_num);
|
||||||
|
if (s->cert->ctypes == NULL)
|
||||||
|
{
|
||||||
|
SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST,ERR_R_MALLOC_FAILURE);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
memcpy(s->cert->ctypes, p, ctype_num);
|
memcpy(s->cert->ctypes, p, ctype_num);
|
||||||
s->cert->ctype_num = (size_t)ctype_num;
|
s->cert->ctype_num = (size_t)ctype_num;
|
||||||
ctype_num=SSL3_CT_NUMBER;
|
ctype_num=SSL3_CT_NUMBER;
|
||||||
|
Loading…
Reference in New Issue
Block a user