]> git.sur5r.net Git - openldap/commitdiff
Fix multi-byte tag parsing
authorHoward Chu <hyc@openldap.org>
Thu, 24 Apr 2003 03:59:45 +0000 (03:59 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 24 Apr 2003 03:59:45 +0000 (03:59 +0000)
libraries/liblber/io.c

index c618d0b286591ff22f26743a9c3d0a61bbdca0af..4928dba08825ff7ee34c45789541b7a93602ce14 100644 (file)
@@ -530,8 +530,10 @@ ber_get_next(
                                for (i=1; (char *)p<ber->ber_rwptr; i++,p++) {
                                        tag <<= 8;
                                        tag |= *p;
-                                       if (!(*p & LBER_MORE_TAG_MASK))
+                                       if (!(*p & LBER_MORE_TAG_MASK)) {
+                                               p++;
                                                break;
+                                       }
                                        /* Is the tag too big? */
                                        if (i == sizeof(ber_tag_t)-1) {
                                                errno = ERANGE;
@@ -542,7 +544,6 @@ ber_get_next(
                                if ((char *)p == ber->ber_rwptr) {
                                        return LBER_DEFAULT;
                                }
-                               p++;
                        }
                        ber->ber_tag = tag;
                        ber->ber_ptr = (char *)p;