summaryrefslogtreecommitdiff
path: root/crypto/asn1/asn1_gen.c
diff options
context:
space:
mode:
authorKurt Roeckx <kurt@roeckx.be>2015-01-24 14:46:50 +0100
committerKurt Roeckx <kurt@roeckx.be>2015-01-24 14:46:50 +0100
commit2747d73c1466c487daf64a1234b6fe2e8a62ac75 (patch)
treef862e6a4a3ecdd9d53ec8d7a6814d7271504043b /crypto/asn1/asn1_gen.c
parentc963c421fb3d84ca3c86284593f0439f7c152f3e (diff)
downloadopenssl-new-2747d73c1466c487daf64a1234b6fe2e8a62ac75.tar.gz
Fix segfault with empty fields as last in the config.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/asn1/asn1_gen.c')
-rw-r--r--crypto/asn1/asn1_gen.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/asn1/asn1_gen.c b/crypto/asn1/asn1_gen.c
index 9ef89f6121..87066e8374 100644
--- a/crypto/asn1/asn1_gen.c
+++ b/crypto/asn1/asn1_gen.c
@@ -279,6 +279,9 @@ static int asn1_cb(const char *elem, int len, void *bitstr)
int tmp_tag, tmp_class;
+ if (elem == NULL)
+ return 0;
+
for (i = 0, p = elem; i < len; p++, i++) {
/* Look for the ':' in name value pairs */
if (*p == ':') {
@@ -805,6 +808,8 @@ static int mask_cb(const char *elem, int len, void *arg)
{
unsigned long *pmask = arg, tmpmask;
int tag;
+ if (elem == NULL)
+ return 0;
if (len == 3 && !strncmp(elem, "DIR", 3)) {
*pmask |= B_ASN1_DIRECTORYSTRING;
return 1;