Commit 11453007 authored by Howard Chu's avatar Howard Chu
Browse files

ITS#2770 - delete bogus maxbuf checks on sasl_read

parent 4c5c632d
...@@ -185,7 +185,7 @@ sb_sasl_remove( Sockbuf_IO_Desc *sbiod ) ...@@ -185,7 +185,7 @@ sb_sasl_remove( Sockbuf_IO_Desc *sbiod )
} }
static ber_len_t 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; ber_len_t size;
...@@ -209,7 +209,7 @@ sb_sasl_pkt_length( const unsigned char *buf, unsigned max, int debuglevel ) ...@@ -209,7 +209,7 @@ sb_sasl_pkt_length( const unsigned char *buf, unsigned max, int debuglevel )
/* Drop a processed packet from the input buffer */ /* Drop a processed packet from the input buffer */
static void 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; ber_slen_t len;
...@@ -220,7 +220,7 @@ sb_sasl_drop_packet ( Sockbuf_Buf *sec_buf_in, unsigned max, int debuglevel ) ...@@ -220,7 +220,7 @@ sb_sasl_drop_packet ( Sockbuf_Buf *sec_buf_in, unsigned max, int debuglevel )
if ( len >= 4 ) { if ( len >= 4 ) {
sec_buf_in->buf_end = sb_sasl_pkt_length( 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 { else {
sec_buf_in->buf_end = 0; sec_buf_in->buf_end = 0;
...@@ -269,7 +269,7 @@ sb_sasl_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len) ...@@ -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 */ /* 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, 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 */ /* Grow the packet buffer if neccessary */
if ( ( p->sec_buf_in.buf_size < (ber_len_t) ret ) && 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) ...@@ -304,8 +304,7 @@ sb_sasl_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
(unsigned *)&p->buf_in.buf_end ); (unsigned *)&p->buf_in.buf_end );
/* Drop the packet from the input buffer */ /* Drop the packet from the input buffer */
sb_sasl_drop_packet( &p->sec_buf_in, sb_sasl_drop_packet( &p->sec_buf_in, sbiod->sbiod_sb->sb_debug );
*p->sasl_maxbuf, sbiod->sbiod_sb->sb_debug );
if ( ret != SASL_OK ) { if ( ret != SASL_OK ) {
ber_log_printf( LDAP_DEBUG_ANY, sbiod->sbiod_sb->sb_debug, ber_log_printf( LDAP_DEBUG_ANY, sbiod->sbiod_sb->sb_debug,
......
...@@ -398,6 +398,8 @@ ldap_int_destroy_global_options(void) ...@@ -398,6 +398,8 @@ ldap_int_destroy_global_options(void)
{ {
struct ldapoptions *gopts = LDAP_INT_GLOBAL_OPT(); struct ldapoptions *gopts = LDAP_INT_GLOBAL_OPT();
gopts->ldo_valid = LDAP_UNINITIALIZED;
if ( gopts->ldo_defludp ) { if ( gopts->ldo_defludp ) {
ldap_free_urllist( gopts->ldo_defludp ); ldap_free_urllist( gopts->ldo_defludp );
gopts->ldo_defludp = NULL; gopts->ldo_defludp = NULL;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment