[Date Prev][Date Next] [Chronological] [Thread] [Top]

slapadd segfaults (ITS#2587)

Using ElectricFence,  I saw that the clean up code in
caseIgnoreIA5SubstringsIndexer at line 3254 in schema_init.c
was freeing data that was already freed. In this case an error
was detected by telephoneNumberNormalize (schema_init.c:1789)
and it had freed the normalized berval,  but it returned the 
address of the normalized berval along w/ the error LDAP_INVALID_SYNTAX 
to the caller caseIgnoreIA5SubstringsIndexer.  I changed the 
normalizer to not return the normalized berval address.

Here's my patch against Openldap-2.1.21

*** schema_init.c.orig  Wed May  7 18:13:39 2003
--- schema_init.c       Fri Jun 13 10:31:21 2003
*** 1810,1815 ****
--- 1810,1816 ----
        if( normalized->bv_len == 0 ) {
                free( normalized->bv_val );
+               normalized->bv_val = NULL;
                return LDAP_INVALID_SYNTAX;