]> git.sur5r.net Git - openldap/commitdiff
Fix reading multibyte lengths
authorHoward Chu <hyc@openldap.org>
Thu, 22 May 2003 06:24:23 +0000 (06:24 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 22 May 2003 06:24:23 +0000 (06:24 +0000)
libraries/liblber/io.c

index ecab5860ae3cffbbf558fc92e9c31fec3e5cec7a..65913a40961a39a14f39d6dce328e8f777b833ea 100644 (file)
@@ -551,12 +551,19 @@ ber_get_next(
                                        return LBER_DEFAULT;
                                }
                        }
-                       if (sblen == 1) continue;
-
                        ber->ber_tag = tag;
                        ber->ber_ptr = (char *)p;
                }
 
+               if ( ber->ber_ptr == ber->ber_rwptr ) {
+#if defined( EWOULDBLOCK )
+                       errno = EWOULDBLOCK;
+#elif defined( EAGAIN )
+                       errno = EAGAIN;
+#endif                 
+                       return LBER_DEFAULT;
+               }
+
                /* Now look for the length */
                if (*ber->ber_ptr & 0x80) {     /* multi-byte */
                        ber_len_t i;