assert( ber != NULL );
assert( LBER_VALID( ber ) );
- if ( ber_read( ber, (char *) &xbyte, 1 ) != 1 ) {
+ if ( ber_pvt_ber_remaining( ber ) < 1 ) {
return LBER_DEFAULT;
}
+ if ( ber->ber_ptr == ber->ber_buf )
+ xbyte = *ber->ber_ptr;
+ else
+ xbyte = ber->ber_tag;
+ ber->ber_ptr++;
+
tag = xbyte;
if ( (xbyte & LBER_BIG_TAG_MASK) != LBER_BIG_TAG_MASK ) {
if( *len > (ber_len_t) ber_pvt_ber_remaining( ber ) ) {
return LBER_DEFAULT;
}
+ ber->ber_tag = *ber->ber_ptr;
return tag;
}
*/
char *save;
- ber_tag_t tag;
+ ber_tag_t tag, old;
+ old = ber->ber_tag;
save = ber->ber_ptr;
tag = ber_skip_tag( ber, len );
ber->ber_ptr = save;
+ ber->ber_tag = old;
return tag;
}
} else {
*num = 0;
}
+ ber->ber_tag = *ber->ber_ptr;
return len;
}
if ( (ber_len_t) ber_read( ber, buf, datalen ) != datalen ) {
return LBER_DEFAULT;
}
+ ber->ber_tag = *ber->ber_ptr;
buf[datalen] = '\0';
return LBER_DEFAULT;
}
bv->bv_val[bv->bv_len] = '\0';
+ ber->ber_tag = *ber->ber_ptr;
return tag;
}
*buf = NULL;
return LBER_DEFAULT;
}
+ ber->ber_tag = *ber->ber_ptr;
*blen = datalen * 8 - unusedbits;
return tag;
if ( len != 0 ) {
return LBER_DEFAULT;
}
+ ber->ber_tag = *ber->ber_ptr;
return( tag );
}
*last = NULL;
return LBER_DEFAULT;
}
+ ber->ber_tag = *ber->ber_ptr;
*last = ber->ber_ptr + *len;
if ( (rc = ber_skip_tag( ber, &len )) == LBER_DEFAULT )
break;
ber->ber_ptr += len;
+ ber->ber_tag = *ber->ber_ptr;
break;
case '{': /* begin sequence */
}
if (ber->ber_buf==NULL) {
- ber->ber_buf = (char *) LBER_MALLOC( ber->ber_len );
+ ber->ber_buf = (char *) LBER_MALLOC( ber->ber_len + 1 );
if (ber->ber_buf==NULL) {
return LBER_DEFAULT;
}