From: Kurt Cancemi Date: Thu, 7 May 2015 20:12:33 +0000 (-0400) Subject: Add missing NULL check in X509V3_parse_list() X-Git-Tag: OpenSSL_1_0_2b~79 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=833518cf0e1e5224383a45cc68c8bb9c3a60865c;p=oweals%2Fopenssl.git Add missing NULL check in X509V3_parse_list() Matt's note: I added a call to X509V3err to Kurt's original patch. RT#3840 Signed-off-by: Matt Caswell Reviewed-by: Rich Salz (cherry picked from commit 344c271eb339fc2982e9a3584a94e51112d84584) --- diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c index e73a7a9c56..bdd7b95f45 100644 --- a/crypto/x509v3/v3_utl.c +++ b/crypto/x509v3/v3_utl.c @@ -285,6 +285,10 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line) int state; /* We are going to modify the line so copy it first */ linebuf = BUF_strdup(line); + if (linebuf == NULL) { + X509V3err(X509V3_F_X509V3_PARSE_LIST, ERR_R_MALLOC_FAILURE); + goto err; + } state = HDR_NAME; ntmp = NULL; /* Go through all characters */