From: Kurt Zeilenga Date: Wed, 2 Sep 1998 16:12:07 +0000 (+0000) Subject: Fixed null termination bug in re.c. Found by vasquez@w270.de X-Git-Tag: PHP3_TOOL_0_0~88 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e9233c923ddb31a1302309e0446a8e8ffacef0f9;p=openldap Fixed null termination bug in re.c. Found by vasquez@w270.de --- diff --git a/servers/slurpd/re.c b/servers/slurpd/re.c index f0a60c8e9e..ea2960f671 100644 --- a/servers/slurpd/re.c +++ b/servers/slurpd/re.c @@ -186,6 +186,7 @@ Re_parse( case T_DN: re->re_dn = ch_malloc( len + 1 ); memcpy( re->re_dn, value, len ); + re->re_dn[ len ]='\0'; state |= GOT_DN; break; default: @@ -227,6 +228,7 @@ Re_parse( if ( value != NULL ) { re->re_mods[ nml ].mi_val = ch_malloc( len + 1 ); memcpy( re->re_mods[ nml ].mi_val, value, len ); + re->re_mods[ nml ].mi_val[ len ] = '\0'; re->re_mods[ nml ].mi_len = len; } else { re->re_mods[ nml ].mi_val = NULL;