]> git.sur5r.net Git - openldap/commitdiff
Fix off by one bug
authorKurt Zeilenga <kurt@openldap.org>
Thu, 12 Apr 2001 23:05:02 +0000 (23:05 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 12 Apr 2001 23:05:02 +0000 (23:05 +0000)
libraries/libldap/schema.c

index 06c41b094d6f1bfa7e75be62a11346b90d5d8961..094e9e06cc7632f9ce74f58d80dc6fd5669aaf1b 100644 (file)
@@ -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 */