From 17f2953e40fc8ae400bc92a3013962cf3fb6c76d Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Sun, 2 Feb 2003 12:20:38 +0000 Subject: [PATCH] Do not crash when more than one attribute is passed to slapi_search_internal_bind() --- servers/slapd/slapi/slapi_ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ) { -- 2.39.5