]> git.sur5r.net Git - openldap/commitdiff
Fixed null termination bug in re.c. Found by vasquez@w270.de
authorKurt Zeilenga <kurt@openldap.org>
Wed, 2 Sep 1998 16:12:07 +0000 (16:12 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 2 Sep 1998 16:12:07 +0000 (16:12 +0000)
servers/slurpd/re.c

index f0a60c8e9e1da7a839661b6fa7e1c4f615fad4ea..ea2960f67142255b964c733445b79931151422bc 100644 (file)
@@ -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;