fix last commit

This commit is contained in:
Kurt Zeilenga 2004-06-29 17:48:19 +00:00
parent a593343aa5
commit 1ded030427
2 changed files with 8 additions and 4 deletions

View File

@ -362,13 +362,18 @@ sb_sasl_write( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
#else
ber_pvt_sb_buf_destroy( &p->buf_out );
#endif
if ( len > *p->sasl_maxbuf - 100 )
unsigned tmpsize = p->buf_out.buf_size;
if ( len > *p->sasl_maxbuf - 100 ) {
len = *p->sasl_maxbuf - 100; /* For safety margin */
}
{
unsigned tmpsize = p->buf_out.buf_size;
ret = sasl_encode( p->sasl_context, buf, len,
(SASL_CONST char **)&p->buf_out.buf_base,
&tmpsize );
p->buf_out.buf_size = tmpsize;
}
if ( ret != SASL_OK ) {
ber_log_printf( LDAP_DEBUG_ANY, sbiod->sbiod_sb->sb_debug,
"sb_sasl_write: failed to encode packet: %s\n",

View File

@ -38,7 +38,7 @@ int ldap_grouping_create(
{
int rc;
BerElement *ber = NULL;
struct berval bv = {0, NULL};
struct berval bv = BER_BVNULL;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_grouping_create\n", 0,0,0 );
@ -65,7 +65,6 @@ int ldap_grouping_create(
}
rc = ber_flatten2( ber, &bv, 0 );
if( rc < 0 ) {
ld->ld_errno = LDAP_ENCODING_ERROR;
return( ld->ld_errno );