From: Howard Chu Date: Thu, 14 Nov 2013 11:02:07 +0000 (-0800) Subject: ITS#7746 fix for cert with NULL issuerDN X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5328340d35562a082d22a64716583bb2052a5cf9;p=openldap ITS#7746 fix for cert with NULL issuerDN --- 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;