]> git.sur5r.net Git - openldap/commitdiff
Do not crash when more than one attribute is passed to
authorLuke Howard <lukeh@openldap.org>
Sun, 2 Feb 2003 12:20:38 +0000 (12:20 +0000)
committerLuke Howard <lukeh@openldap.org>
Sun, 2 Feb 2003 12:20:38 +0000 (12:20 +0000)
slapi_search_internal_bind()

servers/slapd/slapi/slapi_ops.c

index 6855267351393c280de28cb82c9c127a7263cd1e..bbf6b74962cb86279d6c779faf13ad0e5dee43f4 100644 (file)
@@ -1119,7 +1119,7 @@ slapi_search_internal_bind(
        }\r
 \r
        if (i > 0) {\r
-               an = (AttributeName *)slapi_ch_calloc(1, sizeof(AttributeName));\r
+               an = (AttributeName *)slapi_ch_calloc( (i + 1), sizeof(AttributeName) );\r
                for (i = 0; attrs[i] != 0; i++) {\r
                        an[i].an_desc = NULL;\r
                        an[i].an_oc = NULL;\r
@@ -1127,6 +1127,7 @@ slapi_search_internal_bind(
                        an[i].an_name.bv_len = slapi_strlen(attrs[i]);\r
                        slap_bv2ad( &an[i].an_name, &an[i].an_desc, &text );\r
                }\r
+               an[i].an_name.bv_val = NULL;\r
        }\r
 \r
        if ( scope == LDAP_SCOPE_BASE ) {\r