From 97b0c98ab559867790ac1ba23e19f37ce417bd6a Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 13 May 2007 09:36:52 +0000 Subject: [PATCH] Don't use strdup on bervals --- servers/slapd/schema_init.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 91ea8b9004..7556341f3b 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -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 ) { -- 2.39.5