/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2003-2012 The OpenLDAP Foundation.
+ * Copyright 2003-2013 The OpenLDAP Foundation.
* Portions Copyright 2003 Pierangelo Masarati.
* All rights reserved.
*
break;
case LDAP_REQ_MODRDN:
if ( op->orr_newSup != ros->orr_newSup ) {
- ch_free( op->orr_newSup->bv_val );
- ch_free( op->orr_nnewSup->bv_val );
- op->o_tmpfree( op->orr_newSup, op->o_tmpmemctx );
- op->o_tmpfree( op->orr_nnewSup, op->o_tmpmemctx );
+ if ( op->orr_newSup ) {
+ ch_free( op->orr_newSup->bv_val );
+ ch_free( op->orr_nnewSup->bv_val );
+ op->o_tmpfree( op->orr_newSup, op->o_tmpmemctx );
+ op->o_tmpfree( op->orr_nnewSup, op->o_tmpmemctx );
+ }
op->orr_newSup = ros->orr_newSup;
op->orr_nnewSup = ros->orr_nnewSup;
}
NULL );
if ( rc != LDAP_SUCCESS ) {
- BER_BVZERO( &(*ap)->a_nvals[i] );
+ /* FIXME: this is wrong, putting a non-normalized value
+ * into nvals. But when a proxy sends us bogus data,
+ * we still need to give it to the client, even if it
+ * violates the syntax. I.e., we don't want to silently
+ * drop things and trigger an apparent data loss.
+ */
+ ber_dupbv( &(*ap)->a_nvals[i], &(*ap)->a_vals[i] );
}
}
BER_BVZERO( &(*ap)->a_nvals[i] );