]> git.sur5r.net Git - openldap/commitdiff
ITS#6344
authorQuanah Gibson-Mount <quanah@openldap.org>
Sat, 31 Oct 2009 00:57:34 +0000 (00:57 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Sat, 31 Oct 2009 00:57:34 +0000 (00:57 +0000)
CHANGES
libraries/liblber/encode.c

diff --git a/CHANGES b/CHANGES
index ba16521d4ebf3e7a4e1f7d4d818923a272163e62..56f6f22ac375b88649343bb9d56007f1f0c846ac 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,7 @@
 OpenLDAP 2.4 Change Log
 
 OpenLDAP 2.4.20 Engineering
+       Fixed liblber to return failure on certain failures (ITS#6344)
        Fixed libldap uninitialized return value (ITS#6355)
        Fixed liblutil constant (ITS#5909)
        Added slapd handling of hex server IDs (ITS#6297)
index a5c1de0286aec974b5857a0cf59569ecf1a0436e..d2a432fe1e1697de7399130449525b66fd637236 100644 (file)
@@ -151,6 +151,7 @@ ber_encode_oid( BerValue *in, BerValue *out )
                        der[j] = tmp;
                }
                der += len;
+
                if ( ptr == inend )
                        break;
 
@@ -242,10 +243,10 @@ ber_put_ostring(
        rc = ber_write( ber, (char *) ptr, &header[sizeof(header)] - ptr, 0 );
        if ( rc >= 0 && ber_write( ber, str, len, 0 ) >= 0 ) {
                /* length(tag + length + contents) */
-               rc += (int) len;
+               return rc + (int) len;
        }
 
-       return rc;
+       return -1;
 }
 
 int
@@ -300,10 +301,10 @@ ber_put_bitstring(
        rc = ber_write( ber, (char *) ptr, &header[sizeof(header)] - ptr, 0 );
        if ( rc >= 0 && ber_write( ber, str, len, 0 ) >= 0 ) {
                /* length(tag + length + unused bit count + bitstring) */
-               rc += (int) len;
+               return rc + (int) len;
        }
 
-       return rc;
+       return -1;
 }
 
 int