From: Matt Caswell Date: Tue, 10 Mar 2015 23:15:15 +0000 (+0000) Subject: Fix seg fault in ASN1_generate_v3/ASN1_generate_nconf X-Git-Tag: OpenSSL_1_0_2a~40 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9c5c18500bfb58fe0eedfbab71409b6ebc4d2d4c;p=oweals%2Fopenssl.git Fix seg fault in ASN1_generate_v3/ASN1_generate_nconf Reviewed-by: Dr. Stephen Henson (cherry picked from commit ac5a110621ca48f0bebd5b4d76d081de403da29e) --- diff --git a/crypto/asn1/asn1_gen.c b/crypto/asn1/asn1_gen.c index b71ae4841b..11b582dd37 100644 --- a/crypto/asn1/asn1_gen.c +++ b/crypto/asn1/asn1_gen.c @@ -353,6 +353,10 @@ static int asn1_cb(const char *elem, int len, void *bitstr) break; case ASN1_GEN_FLAG_FORMAT: + if(!vstart) { + ASN1err(ASN1_F_ASN1_CB, ASN1_R_UNKNOWN_FORMAT); + return -1; + } if (!strncmp(vstart, "ASCII", 5)) arg->format = ASN1_GEN_FORMAT_ASCII; else if (!strncmp(vstart, "UTF8", 4))