]> git.sur5r.net Git - openldap/commitdiff
Don't use strdup on bervals
authorHoward Chu <hyc@openldap.org>
Sun, 13 May 2007 09:36:52 +0000 (09:36 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 13 May 2007 09:36:52 +0000 (09:36 +0000)
servers/slapd/schema_init.c

index 91ea8b9004b1f510afa44eb92ecdaa5e1f95f243..7556341f3b5122218b4248821e489aaac8d6da5b 100644 (file)
@@ -2117,7 +2117,11 @@ IA5StringNormalize(
        /* Ignore initial whitespace */
        while ( ASCII_SPACE( *p ) ) p++;
 
-       normalized->bv_val = ber_strdup_x( p, ctx );
+       normalized->bv_len = val->bv_len - ( p - val->bv_val );
+       normalized->bv_val = slap_sl_malloc( normalized->bv_len + 1, ctx );
+       AC_MEMCPY( normalized->bv_val, p, normalized->bv_len );
+       normalized->bv_val[normalized->bv_len] = '\0';
+
        p = q = normalized->bv_val;
 
        while ( *p ) {