Commit 0145d543 authored by Howard Chu's avatar Howard Chu
Browse files

In build_new_dn, rdn may be part of a larger string, use strncopy.

parent 2c89c53c
...@@ -1299,7 +1299,7 @@ build_new_dn( struct berval * new_dn, ...@@ -1299,7 +1299,7 @@ build_new_dn( struct berval * new_dn,
new_dn->bv_len = parent_dn->bv_len + newrdn->bv_len + 1; new_dn->bv_len = parent_dn->bv_len + newrdn->bv_len + 1;
new_dn->bv_val = (char *) slap_sl_malloc( new_dn->bv_len + 1, memctx ); new_dn->bv_val = (char *) slap_sl_malloc( new_dn->bv_len + 1, memctx );
ptr = lutil_strcopy( new_dn->bv_val, newrdn->bv_val ); ptr = lutil_strncopy( new_dn->bv_val, newrdn->bv_val, newrdn->bv_len );
*ptr++ = ','; *ptr++ = ',';
strcpy( ptr, parent_dn->bv_val ); strcpy( ptr, parent_dn->bv_val );
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment