[Date Prev][Date Next] [Chronological] [Thread] [Top]

perl backend and Modification.sm_values



hi!

the perl backend sends parts of the ldap request message as parameters
to certain functions of a specified perl module.

for example, in case of an ModifyRequest, in the file:

servers/slapd/back-perl/modify.c

function:

int
perl_back_modify(
    Operation   *op,
    SlapReply   *rs )

I see this starting with line 60:

            for ( i = 0;
                mods->sm_values != NULL && mods->sm_values[i].bv_val != NULL;
                i++ )
            {
                XPUSHs(sv_2mortal(newSVpv( mods->sm_values[i].bv_val, 0 ))); <--- SAFE ???
            }

perlguts (http://perldoc.perl.org/perlguts.html#Working-with-SVs) says about
newSVpv():

"Notice that you can choose to specify the length of the string to be assigned
by using sv_setpvn , newSVpvn , or newSVpv , or you may allow Perl to calculate
the length by using sv_setpv or by specifying 0 as the second argument to
newSVpv . Be warned, though, that Perl will determine the string's length by
using strlen , which depends on the string terminating with a NUL
character."

is it safe to assume that bc_val points to something that terminates
with '\0' ??

thanks!
bye now!
cristian