]> git.sur5r.net Git - openldap/commitdiff
Further trim_refs_url fixes from Hallvard. Need additional testing.
authorKurt Zeilenga <kurt@openldap.org>
Sun, 5 Sep 1999 22:32:01 +0000 (22:32 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 5 Sep 1999 22:32:01 +0000 (22:32 +0000)
servers/slapd/result.c

index 7580a579e08d44e4948ec318f25ff43cccd5d449..f5038ac540e566dadd5b1c01e9fdf8c002325d36 100644 (file)
@@ -78,12 +78,12 @@ static void trim_refs_urls(
        if( refs == NULL ) return;
 
        for( i=0; refs[i] != NULL; i++ ) {
-               if(     refs[i]->bv_len > sizeof("ldap://") &&
+               if(     refs[i]->bv_len > sizeof("ldap://")-1 &&
                        strncasecmp( refs[i]->bv_val, "ldap://",
                                sizeof("ldap://")-1 ) == 0 )
                {
                        unsigned j;
-                       for( j=sizeof("ldap://"); j<refs[i]->bv_len ; j++ ) {
+                       for( j=sizeof("ldap://")-1; j<refs[i]->bv_len ; j++ ) {
                                if( refs[i]->bv_val[j] == '/' ) {
                                        refs[i]->bv_val[j] = '\0';
                                        refs[i]->bv_len = j;