From: Pierangelo Masarati Date: Tue, 2 Oct 2007 18:24:09 +0000 (+0000) Subject: fix ITS#5163 (re23 only) X-Git-Tag: OPENLDAP_REL_ENG_2_3_39~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4cf2c23e90d725c604dbc57332a7e281f2d456b;p=thirdparty%2Fopenldap.git fix ITS#5163 (re23 only) --- diff --git a/CHANGES b/CHANGES index d3712994fa..fd6887c589 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,7 @@ OpenLDAP 2.3.39 Engineering Fixed slapd-sql concurrency issue (ITS#5095) Fixed slapo-chain double-free (ITS#5137) Fixed slapo-pcache and -rwm interaction fix (ITS#4991) + Fixed slapo-pcache non-null terminated array crasher (ITS#5163) Fixed slapo-rwm modlist handling (ITS#5124) Fixed liblber Windows x64 portability (ITS#5105) Fixed libldap ppolicy control creation (ITS#5103) diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 85bf03c3c4..c42eaa9e05 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -1134,8 +1134,8 @@ add_filter_attrs( count++; } - *new_attrs = (AttributeName*)ch_malloc((count+1)* - sizeof(AttributeName)); + *new_attrs = (AttributeName*)ch_calloc( count + 1, + sizeof(AttributeName) ); for (i=0; icount; i++) { (*new_attrs)[i].an_name = attrs->attrs[i].an_name; (*new_attrs)[i].an_desc = attrs->attrs[i].an_desc; @@ -1155,18 +1155,13 @@ add_filter_attrs( continue; (*new_attrs)[j].an_name = filter_attrs[i].an_name; (*new_attrs)[j].an_desc = filter_attrs[i].an_desc; - (*new_attrs)[j].an_oc = NULL; - (*new_attrs)[j].an_oc_exclude = 0; j++; } if ( addoc ) { (*new_attrs)[j].an_name = slap_schema.si_ad_objectClass->ad_cname; (*new_attrs)[j].an_desc = slap_schema.si_ad_objectClass; - (*new_attrs)[j].an_oc = NULL; - (*new_attrs)[j].an_oc_exclude = 0; j++; } - BER_BVZERO( &(*new_attrs)[j].an_name ); } /* NOTE: this is a quick workaround to let pcache minimally interact