]> git.sur5r.net Git - openldap/commitdiff
ITS#3212: sasl_encode/decode 64-bit clean bug
authorKurt Zeilenga <kurt@openldap.org>
Tue, 29 Jun 2004 21:25:35 +0000 (21:25 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 29 Jun 2004 21:25:35 +0000 (21:25 +0000)
CHANGES
libraries/libldap/cyrus.c

diff --git a/CHANGES b/CHANGES
index 2dba1f8977d3b1a1f5b93159abc084fd3a7ad674..599ff5a82ad63a5e34d56e1f95881025b251a462 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@ OpenLDAP 2.2 Change Log
 
 OpenLDAP 2.2.15 Engineering
        Fixed invalid cookie in pagedResults control (ITS#3089)
+       Fixed libldap sasl_encode 64-bit bug (ITS#3054,3212)
+       Fixed libldap_r runqueue
+       Build environments
+               Added default ldapi:// SSF build setting
 
 OpenLDAP 2.2.14 Release
        Fixed back-bdb ignore deadlock bug (ITS#3188)
@@ -29,7 +33,7 @@ OpenLDAP 2.2.12 Release
        Fixed slapd first component bug (ITS#3118)
        Fixed slapd TOLOWER macro use bug (ITS#3115)
        Fixed slapd TLS context clash bug (ITS#3109)
-       Fixed slapd set acl recursion (ITS#3140)
+       Fixed slapd ACL set recursion (ITS#3140)
        Fixed slapd entry2mods normalization bug (ITS#3144,3152)
        Fixed slapd extended match memory leak (ITS#3146)
        Fixed slapd syncrepl persist interval issue (ITS#3064)
index d98b534863e7272ab4cf2a457597e753db1ef9f9..2c55ce0d21f2936309bdb3e79d988c3c8c91eb9a 100644 (file)
@@ -306,10 +306,14 @@ sb_sasl_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
        }
 
        /* Decode the packet */
-       ret = sasl_decode( p->sasl_context, p->sec_buf_in.buf_base,
-               p->sec_buf_in.buf_end,
-               (SASL_CONST char **)&p->buf_in.buf_base,
-               (unsigned *)&p->buf_in.buf_end );
+       {
+               unsigned tmpsize = p->buf_in.buf_end;
+               ret = sasl_decode( p->sasl_context, p->sec_buf_in.buf_base,
+                       p->sec_buf_in.buf_end,
+                       (SASL_CONST char **)&p->buf_in.buf_base,
+                       (unsigned *)&tmpsize );
+               p->buf_in.buf_end = tmpsize;
+       }
 
        /* Drop the packet from the input buffer */
        sb_sasl_drop_packet( &p->sec_buf_in, sbiod->sbiod_sb->sb_debug );
@@ -358,11 +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 )
+       if ( len > *p->sasl_maxbuf - 100 ) {
                len = *p->sasl_maxbuf - 100;    /* For safety margin */
-       ret = sasl_encode( p->sasl_context, buf, len,
-               (SASL_CONST char **)&p->buf_out.buf_base,
-               (unsigned *)&p->buf_out.buf_size );
+       }
+
+       {
+               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",