From: Kurt Zeilenga Date: Tue, 18 Aug 1998 19:05:33 +0000 (+0000) Subject: Add patch from Gordon Good to fix copying of DNs with null bytes. X-Git-Tag: OPENLDAP_REL_ENG_1_0_0~31 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3eb609ab21d4a3cfa0da16a23be12556028eed30;p=openldap Add patch from Gordon Good to fix copying of DNs with null bytes. --- diff --git a/servers/slurpd/re.c b/servers/slurpd/re.c index 401630d7de..f5168d8296 100644 --- a/servers/slurpd/re.c +++ b/servers/slurpd/re.c @@ -184,7 +184,8 @@ Re_parse( state |= GOT_TIME; break; case T_DN: - re->re_dn = strdup( value ); + re->re_dn = calloc( 1, len + 1 ); + memcpy( re->re_dn, value, len ); state |= GOT_DN; break; default: @@ -224,7 +225,8 @@ Re_parse( sizeof( Mi ) * ( nml + 2 )); re->re_mods[ nml ].mi_type = strdup( type ); if ( value != NULL ) { - re->re_mods[ nml ].mi_val = strdup( value ); + re->re_mods[ nml ].mi_val = calloc( 1, len + 1 ); + memcpy( re->re_mods[ nml ].mi_val, value, len ); re->re_mods[ nml ].mi_len = len; } else { re->re_mods[ nml ].mi_val = NULL;