mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Fix off by one bug
This commit is contained in:
parent
9d3e3aa5dc
commit
66fdd720f4
@ -126,6 +126,10 @@ append_to_safe_string(safe_string * ss, char * s)
|
||||
/* We always make sure there is at least one position available */
|
||||
if ( ss->pos + l >= ss->size-1 ) {
|
||||
ss->size *= 2;
|
||||
if ( ss->pos + l >= ss->size-1 ) {
|
||||
ss->size = ss->pos + l + 1;
|
||||
}
|
||||
|
||||
temp = LDAP_REALLOC(ss->val, ss->size);
|
||||
if ( !temp ) {
|
||||
/* Trouble, out of memory */
|
||||
|
Loading…
Reference in New Issue
Block a user