From 5328340d35562a082d22a64716583bb2052a5cf9 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 14 Nov 2013 03:02:07 -0800 Subject: [PATCH] ITS#7746 fix for cert with NULL issuerDN --- servers/slapd/schema_init.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index d177795925..d4f5024b30 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -3713,12 +3713,14 @@ certificateExactNormalize( tag = ber_skip_tag( ber, &len ); /* SignatureAlg */ ber_skip_data( ber, len ); tag = ber_peek_tag( ber, &len ); /* IssuerDN */ - len = ber_ptrlen( ber ); - bvdn.bv_val = val->bv_val + len; - bvdn.bv_len = val->bv_len - len; + if ( len ) { + len = ber_ptrlen( ber ); + bvdn.bv_val = val->bv_val + len; + bvdn.bv_len = val->bv_len - len; - rc = dnX509normalize( &bvdn, &issuer_dn ); - if ( rc != LDAP_SUCCESS ) goto done; + rc = dnX509normalize( &bvdn, &issuer_dn ); + if ( rc != LDAP_SUCCESS ) goto done; + } normalized->bv_len = STRLENOF( "{ serialNumber , issuer rdnSequence:\"\" }" ) + sn2.bv_len + issuer_dn.bv_len;