-
- /*
- * first time through - malloc the buffer, set up ptrs, and
- * read the tag and the length and as much of the rest as we can
- */
-
- if ( ber->ber_rwptr == NULL ) {
- /*
- * First, we read the tag.
- */
-
- if ( (tag = get_tag( sb )) == LBER_DEFAULT ) {
- return( LBER_DEFAULT );
- }
- ber->ber_tag = tag;
-
- /*
- * Next, read the length. The first byte contains the length
- * of the length. If bit 8 is set, the length is the long
- * form, otherwise it's the short form. We don't allow a
- * length that's greater than what we can hold in an unsigned
- * long.