mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-27 01:59:38 -05:00
Fix multi-byte tag parsing
This commit is contained in:
parent
bcf7ab26e4
commit
b6111d793e
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue