diff options
author | Matt Caswell <matt@openssl.org> | 2016-08-22 23:41:15 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-08-23 00:19:15 +0100 |
commit | a36c5eabf589aef716966fbbc8772ead1205abd7 (patch) | |
tree | ac683dc53f87442670bc621440dc3bdf368b744f /crypto/objects | |
parent | b197257d71694fd52ab61d173f77c8a120d3eead (diff) | |
download | openssl-a36c5eabf589aef716966fbbc8772ead1205abd7.tar.gz |
Sanity check an ASN1_object_size result
If it's negative don't try and malloc it.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/objects')
-rw-r--r-- | crypto/objects/obj_dat.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index bb50f63c0a..259851bc00 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -373,6 +373,8 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name) } /* Work out total size */ j = ASN1_object_size(0, i, V_ASN1_OBJECT); + if (j < 0) + return NULL; if ((buf = OPENSSL_malloc(j)) == NULL) return NULL; |