]> git.sur5r.net Git - openldap/commitdiff
ITS#2770 - delete bogus maxbuf checks on sasl_read
authorHoward Chu <hyc@openldap.org>
Thu, 16 Oct 2003 18:56:02 +0000 (18:56 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 16 Oct 2003 18:56:02 +0000 (18:56 +0000)
libraries/libldap/cyrus.c
libraries/libldap/init.c

index 1816d8d7c386129a2bb9064c22f59be30265a0cf..121fb424eb1f5f726d58de7a51937c005a5464e0 100644 (file)
@@ -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,
index 1a09236687c90031451ac9d8eca6e7ed6b0ab2e5..37c4298b7c356653521e180c89862e45180a80d3 100644 (file)
@@ -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;