From: Luke Howard Date: Sun, 2 Feb 2003 12:20:38 +0000 (+0000) Subject: Do not crash when more than one attribute is passed to X-Git-Tag: NO_SLAP_OP_BLOCKS~448 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=17f2953e40fc8ae400bc92a3013962cf3fb6c76d;p=openldap Do not crash when more than one attribute is passed to slapi_search_internal_bind() --- diff --git a/servers/slapd/slapi/slapi_ops.c b/servers/slapd/slapi/slapi_ops.c index 6855267351..bbf6b74962 100644 --- a/servers/slapd/slapi/slapi_ops.c +++ b/servers/slapd/slapi/slapi_ops.c @@ -1119,7 +1119,7 @@ slapi_search_internal_bind( } if (i > 0) { - an = (AttributeName *)slapi_ch_calloc(1, sizeof(AttributeName)); + an = (AttributeName *)slapi_ch_calloc( (i + 1), sizeof(AttributeName) ); for (i = 0; attrs[i] != 0; i++) { an[i].an_desc = NULL; an[i].an_oc = NULL; @@ -1127,6 +1127,7 @@ slapi_search_internal_bind( an[i].an_name.bv_len = slapi_strlen(attrs[i]); slap_bv2ad( &an[i].an_name, &an[i].an_desc, &text ); } + an[i].an_name.bv_val = NULL; } if ( scope == LDAP_SCOPE_BASE ) {