mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
Coverity #1451596: check dirlen for being negative
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/9362)
This commit is contained in:
parent
b481fbe68b
commit
35e264c032
@ -184,6 +184,8 @@ static int ndef_suffix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
|
||||
return 0;
|
||||
|
||||
derlen = ASN1_item_ndef_i2d(ndef_aux->val, NULL, ndef_aux->it);
|
||||
if (derlen < 0)
|
||||
return 0;
|
||||
if ((p = OPENSSL_malloc(derlen)) == NULL) {
|
||||
ASN1err(ASN1_F_NDEF_SUFFIX, ERR_R_MALLOC_FAILURE);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user