diff options
author | Jonas Maebe <jonas.maebe@elis.ugent.be> | 2013-12-08 22:47:10 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2014-08-17 18:56:05 +0200 |
commit | 54298141d39600c4a6872f4440f4f843bcf84669 (patch) | |
tree | d5c630e14de98c86fb6f3e5dd9974b3a43705d22 /crypto/x509v3 | |
parent | f6983d0d7618d6fb47c29c5e337eeeb40ba72b38 (diff) |
do_othername: check for NULL after allocating objtmp
Signed-off-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/x509v3')
-rw-r--r-- | crypto/x509v3/v3_alt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/x509v3/v3_alt.c b/crypto/x509v3/v3_alt.c index d29d94338e..ea1410dd74 100644 --- a/crypto/x509v3/v3_alt.c +++ b/crypto/x509v3/v3_alt.c @@ -579,6 +579,8 @@ static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) return 0; objlen = p - value; objtmp = OPENSSL_malloc(objlen + 1); + if (objtmp == NULL) + return 0; strncpy(objtmp, value, objlen); objtmp[objlen] = 0; gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0); |