Commit 66fdd720 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Fix off by one bug

parent 9d3e3aa5
......@@ -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 */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment