From e9233c923ddb31a1302309e0446a8e8ffacef0f9 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 2 Sep 1998 16:12:07 +0000 Subject: [PATCH] Fixed null termination bug in re.c. Found by vasquez@w270.de --- servers/slurpd/re.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.39.5