From: Kurt Zeilenga Date: Tue, 20 Aug 2002 19:08:18 +0000 (+0000) Subject: ITS#2004 AD lang bug fix X-Git-Tag: NO_SLAP_OP_BLOCKS~1209 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=65760c064ebd9f62048593dca1945d6344651196;p=openldap ITS#2004 AD lang bug fix --- diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 3d1335b435..360da3ca94 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -364,15 +364,18 @@ done:; } static int is_ad_sublang( - const char *sublang, - const char *suplang ) + struct berval *sublangbv, + struct berval *suplangbv ) { - const char *supp, *supdelimp; - const char *subp, *subdelimp; + const char *suplang, *supp, *supdelimp; + const char *sublang, *subp, *subdelimp; int suplen, sublen; - if( suplang == NULL ) return 1; - if( sublang == NULL ) return 0; + if( suplangbv->bv_len == 0 ) return 1; + if( sublangbv->bv_len == 0 ) return 0; + + sublang =sublangbv->bv_val; + suplang =suplangbv->bv_val; for( supp=suplang ; supp; supp=supdelimp ) { supdelimp = strchrlen( supp, ';', &suplen ); @@ -413,7 +416,7 @@ int is_ad_subtype( } /* check for language tags */ - if ( !is_ad_sublang( sub->ad_lang.bv_val, super->ad_lang.bv_val )) { + if ( !is_ad_sublang( &sub->ad_lang, &super->ad_lang )) { return 0; }