ITS#1898: ldap_controls_dup() writes beyond allocated memory

patch suggested by Dave Steck <dsteck@novell.com>
This commit is contained in:
Kurt Zeilenga 2002-06-21 19:14:37 +00:00
parent 2893a78d0a
commit cdce8064e5

View File

@ -285,7 +285,7 @@ ldap_controls_dup( LDAPControl *const *controls )
return NULL; return NULL;
} }
new = (LDAPControl **) LDAP_MALLOC( i * sizeof(LDAPControl *) ); new = (LDAPControl **) LDAP_MALLOC( (i+1) * sizeof(LDAPControl *) );
if( new == NULL ) { if( new == NULL ) {
/* memory allocation failure */ /* memory allocation failure */