From: Howard Chu Date: Thu, 29 Mar 2012 13:11:55 +0000 (-0700) Subject: ITS#7149 more for back-perl, always use bv_len when available X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f6b8103b789ae40234b0cb7574c1a9da4e5a1b21;p=openldap ITS#7149 more for back-perl, always use bv_len when available --- diff --git a/servers/slapd/back-perl/add.c b/servers/slapd/back-perl/add.c index 2fb9b9e00d..0df962b422 100644 --- a/servers/slapd/back-perl/add.c +++ b/servers/slapd/back-perl/add.c @@ -35,7 +35,7 @@ perl_back_add( PUSHMARK(sp); XPUSHs( perl_back->pb_obj_ref ); - XPUSHs(sv_2mortal(newSVpv( entry2str( op->ora_e, &len ), 0 ))); + XPUSHs(sv_2mortal(newSVpv( entry2str( op->ora_e, &len ), len ))); PUTBACK; diff --git a/servers/slapd/back-perl/bind.c b/servers/slapd/back-perl/bind.c index 5b6c8e7d88..192b403fd5 100644 --- a/servers/slapd/back-perl/bind.c +++ b/servers/slapd/back-perl/bind.c @@ -50,7 +50,7 @@ perl_back_bind( PUSHMARK(SP); XPUSHs( perl_back->pb_obj_ref ); - XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , 0))); + XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , op->o_req_dn.bv_len))); XPUSHs(sv_2mortal(newSVpv( op->orb_cred.bv_val , op->orb_cred.bv_len))); PUTBACK; diff --git a/servers/slapd/back-perl/compare.c b/servers/slapd/back-perl/compare.c index 0bd3dd6dfa..7cb561401d 100644 --- a/servers/slapd/back-perl/compare.c +++ b/servers/slapd/back-perl/compare.c @@ -29,14 +29,15 @@ perl_back_compare( Operation *op, SlapReply *rs ) { - int count; + int count, avalen; char *avastr; PerlBackend *perl_back = (PerlBackend *)op->o_bd->be_private; - avastr = ch_malloc( op->orc_ava->aa_desc->ad_cname.bv_len + 1 + - op->orc_ava->aa_value.bv_len + 1 ); - + avalen = op->orc_ava->aa_desc->ad_cname.bv_len + 1 + + op->orc_ava->aa_value.bv_len; + avastr = ch_malloc( avalen + 1 ); + lutil_strcopy( lutil_strcopy( lutil_strcopy( avastr, op->orc_ava->aa_desc->ad_cname.bv_val ), "=" ), op->orc_ava->aa_value.bv_val ); @@ -49,8 +50,8 @@ perl_back_compare( PUSHMARK(sp); XPUSHs( perl_back->pb_obj_ref ); - XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , 0))); - XPUSHs(sv_2mortal(newSVpv( avastr , 0))); + XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , op->o_req_dn.bv_len))); + XPUSHs(sv_2mortal(newSVpv( avastr , avalen))); PUTBACK; count = call_method("compare", G_SCALAR); diff --git a/servers/slapd/back-perl/delete.c b/servers/slapd/back-perl/delete.c index 80c9607480..f72a540697 100644 --- a/servers/slapd/back-perl/delete.c +++ b/servers/slapd/back-perl/delete.c @@ -33,7 +33,7 @@ perl_back_delete( PUSHMARK(sp); XPUSHs( perl_back->pb_obj_ref ); - XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , 0 ))); + XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , op->o_req_dn.bv_len ))); PUTBACK; diff --git a/servers/slapd/back-perl/modrdn.c b/servers/slapd/back-perl/modrdn.c index 31ff2001d5..dcfb080c46 100644 --- a/servers/slapd/back-perl/modrdn.c +++ b/servers/slapd/back-perl/modrdn.c @@ -33,11 +33,11 @@ perl_back_modrdn( PUSHMARK(sp) ; XPUSHs( perl_back->pb_obj_ref ); - XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , 0 ))); - XPUSHs(sv_2mortal(newSVpv( op->orr_newrdn.bv_val , 0 ))); + XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , op->o_req_dn.bv_len ))); + XPUSHs(sv_2mortal(newSVpv( op->orr_newrdn.bv_val , op->orr_newrdn.bv_len ))); XPUSHs(sv_2mortal(newSViv( op->orr_deleteoldrdn ))); if ( op->orr_newSup != NULL ) { - XPUSHs(sv_2mortal(newSVpv( op->orr_newSup->bv_val , 0 ))); + XPUSHs(sv_2mortal(newSVpv( op->orr_newSup->bv_val , op->orr_newSup->bv_len ))); } PUTBACK ; diff --git a/servers/slapd/back-perl/search.c b/servers/slapd/back-perl/search.c index c7428010f8..220e89c779 100644 --- a/servers/slapd/back-perl/search.c +++ b/servers/slapd/back-perl/search.c @@ -42,16 +42,16 @@ perl_back_search( PUSHMARK(sp) ; XPUSHs( perl_back->pb_obj_ref ); - XPUSHs(sv_2mortal(newSVpv( op->o_req_ndn.bv_val , 0))); + XPUSHs(sv_2mortal(newSVpv( op->o_req_ndn.bv_val , op->o_req_ndn.bv_len))); XPUSHs(sv_2mortal(newSViv( op->ors_scope ))); XPUSHs(sv_2mortal(newSViv( op->ors_deref ))); XPUSHs(sv_2mortal(newSViv( op->ors_slimit ))); XPUSHs(sv_2mortal(newSViv( op->ors_tlimit ))); - XPUSHs(sv_2mortal(newSVpv( op->ors_filterstr.bv_val , 0))); + XPUSHs(sv_2mortal(newSVpv( op->ors_filterstr.bv_val , op->ors_filterstr.bv_len))); XPUSHs(sv_2mortal(newSViv( op->ors_attrsonly ))); for ( an = op->ors_attrs; an && an->an_name.bv_val; an++ ) { - XPUSHs(sv_2mortal(newSVpv( an->an_name.bv_val , 0))); + XPUSHs(sv_2mortal(newSVpv( an->an_name.bv_val , an->an_name.bv_len))); } PUTBACK;