diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2004-12-05 02:03:15 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2004-12-05 02:03:15 +0100 |
commit | a0e7c8eede26b29b09057f48b8e51f46f8811ddd (patch) | |
tree | 2b50575b4e9e608b61cb74246915625bd99b85d8 /crypto/x509v3/v3_bitst.c | |
parent | Update year. (diff) | |
download | openssl-a0e7c8eede26b29b09057f48b8e51f46f8811ddd.tar.xz openssl-a0e7c8eede26b29b09057f48b8e51f46f8811ddd.zip |
Add lots of checks for memory allocation failure, error codes to indicate
failure and freeing up memory if a failure occurs.
PR:620
Diffstat (limited to 'crypto/x509v3/v3_bitst.c')
-rw-r--r-- | crypto/x509v3/v3_bitst.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/x509v3/v3_bitst.c b/crypto/x509v3/v3_bitst.c index 42d5f8beff..170c8d280b 100644 --- a/crypto/x509v3/v3_bitst.c +++ b/crypto/x509v3/v3_bitst.c @@ -118,7 +118,12 @@ ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, for(bnam = method->usr_data; bnam->lname; bnam++) { if(!strcmp(bnam->sname, val->name) || !strcmp(bnam->lname, val->name) ) { - ASN1_BIT_STRING_set_bit(bs, bnam->bitnum, 1); + if(!ASN1_BIT_STRING_set_bit(bs, bnam->bitnum, 1)) { + X509V3err(X509V3_F_V2I_ASN1_BIT_STRING, + ERR_R_MALLOC_FAILURE); + M_ASN1_BIT_STRING_free(bs); + return NULL; + } break; } } |