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

Null pointer usage in back-sql/schema-map.c (ITS#2143)



Full_Name: Dana Chee
Version: 2.1.6
OS: Linux 2.4
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (207.3.231.80)


In back-sql/schema-map.c, the Debug statement attempts to use a null pointer. 
If
slap_str2ad failes, then it is likely that at_map->ad never gets set, but there
is
an attempt to use it in the debug statement.

                        rc = slap_str2ad( at_row.cols[ 0 ],
                                        &at_map->ad, &text );
                        if ( rc != LDAP_SUCCESS ) {
                                Debug( LDAP_DEBUG_TRACE, "load_schema_map(): "
                                        "attribute '%s' for objectClass '%s' "
                                        "is not defined in schema: %s\n",
                                        at_map->ad->ad_cname.bv_val,
                                        BACKSQL_OC_NAME( oc_map ), text );
                                return LDAP_CONSTRAINT_VIOLATION;
                        }

For my own testing, I replaced at_map->ad->ad_cname.bv_val with at_row.cols[0]
so
that it would continue.

Thanks,