From: Jonas Maebe Date: Sun, 8 Dec 2013 21:47:10 +0000 (+0100) Subject: do_othername: check for NULL after allocating objtmp X-Git-Tag: master-post-reformat~488 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=54298141d39600c4a6872f4440f4f843bcf84669;p=oweals%2Fopenssl.git do_othername: check for NULL after allocating objtmp Signed-off-by: Kurt Roeckx Reviewed-by: Rich Salz --- 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);