From: Howard Chu Date: Wed, 12 Mar 2003 02:33:53 +0000 (+0000) Subject: ITS#2365 - preserve internal ber_tag as well as ber_ptr for rewinding. X-Git-Tag: NO_SLAP_OP_BLOCKS~142 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=066e3310a96609071f507ec021d5259291f2f1db;p=openldap ITS#2365 - preserve internal ber_tag as well as ber_ptr for rewinding. --- diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index 0f08f8c597..b0a5bd7a7e 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -316,13 +316,12 @@ ber_get_stringbvl( bgbvr *b, ber_len_t *rlen ) struct berval bv, *bvp = NULL; orig = b->ber->ber_ptr; + tag = b->ber->ber_tag; - tag = ber_first_element( b->ber, &len, &last ); - if ( tag != LBER_DEFAULT ) { + if ( ber_first_element( b->ber, &len, &last ) != LBER_DEFAULT ) { for ( ; b->ber->ber_ptr < last; i++ ) { - tag = ber_skip_tag( b->ber, &len ); - if (tag == LBER_DEFAULT) break; + if (ber_skip_tag( b->ber, &len ) == LBER_DEFAULT) break; b->ber->ber_ptr += len; } } @@ -366,6 +365,7 @@ ber_get_stringbvl( bgbvr *b, ber_len_t *rlen ) break; } b->ber->ber_ptr = orig; + b->ber->ber_tag = tag; ber_skip_tag( b->ber, &len ); for (n=0; n