From: Kurt Zeilenga Date: Fri, 21 Jun 2002 21:18:09 +0000 (+0000) Subject: ITS#1898 ldap_controls_dup malloc() bug fix X-Git-Tag: OPENLDAP_REL_ENG_2_1_3~21 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5a2f9b8ad699b62bff333262b13e2511139c79a2;p=openldap ITS#1898 ldap_controls_dup malloc() bug fix --- diff --git a/CHANGES b/CHANGES index 4e763ae932..dfeab80f4c 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,7 @@ OpenLDAP 2.1.3 Engineering Fixed back-ldap/meta mapping bug (ITS#1787) Add back-monitor added monitorContext support Fixed back-perl ad_cname bug (ITS#1882) + Fixed libldap ldap_controls_dup() malloc bug (ITS#1898) Remove lint Build Environment Add monitor backend test @@ -18,6 +19,8 @@ OpenLDAP 2.1.3 Engineering Fix SASL-less build issues Fix back-perl build issues (ITS#1827) Added -ldb-4 detection (ITS#1888) + Documentation + Numerous manual page updates OpenLDAP 2.1.2 Release Initial release for "general" use. diff --git a/libraries/libldap/controls.c b/libraries/libldap/controls.c index 12f455be98..f3af141e1e 100644 --- a/libraries/libldap/controls.c +++ b/libraries/libldap/controls.c @@ -285,7 +285,7 @@ ldap_controls_dup( LDAPControl *const *controls ) return NULL; } - new = (LDAPControl **) LDAP_MALLOC( i * sizeof(LDAPControl *) ); + new = (LDAPControl **) LDAP_MALLOC( (i+1) * sizeof(LDAPControl *) ); if( new == NULL ) { /* memory allocation failure */