From 11453007c24ac8190739325cfa3c1826fc56a0e8 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 16 Oct 2003 18:56:02 +0000 Subject: [PATCH] ITS#2770 - delete bogus maxbuf checks on sasl_read --- libraries/libldap/cyrus.c | 11 +++++------ libraries/libldap/init.c | 2 ++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index 1816d8d7c3..121fb424eb 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -185,7 +185,7 @@ sb_sasl_remove( Sockbuf_IO_Desc *sbiod ) } static ber_len_t -sb_sasl_pkt_length( const unsigned char *buf, unsigned max, int debuglevel ) +sb_sasl_pkt_length( const unsigned char *buf, int debuglevel ) { ber_len_t size; @@ -209,7 +209,7 @@ sb_sasl_pkt_length( const unsigned char *buf, unsigned max, int debuglevel ) /* Drop a processed packet from the input buffer */ static void -sb_sasl_drop_packet ( Sockbuf_Buf *sec_buf_in, unsigned max, int debuglevel ) +sb_sasl_drop_packet ( Sockbuf_Buf *sec_buf_in, int debuglevel ) { ber_slen_t len; @@ -220,7 +220,7 @@ sb_sasl_drop_packet ( Sockbuf_Buf *sec_buf_in, unsigned max, int debuglevel ) if ( len >= 4 ) { sec_buf_in->buf_end = sb_sasl_pkt_length( - (unsigned char *) sec_buf_in->buf_base, max, debuglevel); + (unsigned char *) sec_buf_in->buf_base, debuglevel); } else { sec_buf_in->buf_end = 0; @@ -269,7 +269,7 @@ sb_sasl_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len) /* The new packet always starts at p->sec_buf_in.buf_base */ ret = sb_sasl_pkt_length( (unsigned char *) p->sec_buf_in.buf_base, - *p->sasl_maxbuf, sbiod->sbiod_sb->sb_debug ); + sbiod->sbiod_sb->sb_debug ); /* Grow the packet buffer if neccessary */ if ( ( p->sec_buf_in.buf_size < (ber_len_t) ret ) && @@ -304,8 +304,7 @@ sb_sasl_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len) (unsigned *)&p->buf_in.buf_end ); /* Drop the packet from the input buffer */ - sb_sasl_drop_packet( &p->sec_buf_in, - *p->sasl_maxbuf, sbiod->sbiod_sb->sb_debug ); + sb_sasl_drop_packet( &p->sec_buf_in, sbiod->sbiod_sb->sb_debug ); if ( ret != SASL_OK ) { ber_log_printf( LDAP_DEBUG_ANY, sbiod->sbiod_sb->sb_debug, diff --git a/libraries/libldap/init.c b/libraries/libldap/init.c index 1a09236687..37c4298b7c 100644 --- a/libraries/libldap/init.c +++ b/libraries/libldap/init.c @@ -398,6 +398,8 @@ ldap_int_destroy_global_options(void) { struct ldapoptions *gopts = LDAP_INT_GLOBAL_OPT(); + gopts->ldo_valid = LDAP_UNINITIALIZED; + if ( gopts->ldo_defludp ) { ldap_free_urllist( gopts->ldo_defludp ); gopts->ldo_defludp = NULL; -- 2.39.5