--- libraries/liblber/decode.c 1999/11/26 22:32:20 1.43 +++ libraries/liblber/decode.c 1999/12/09 20:30:33 1.44 @@ -1,5 +1,5 @@ /* decode.c - ber input decoding routines */ -/* $OpenLDAP: pkg/ldap/libraries/liblber/decode.c,v 1.42 1999/11/08 18:36:30 kurt Exp $ */ +/* $OpenLDAP: pkg/ldap/libraries/liblber/decode.c,v 1.43 1999/11/26 22:32:20 kdz Exp $ */ /* * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file @@ -96,6 +96,8 @@ ber_skip_tag( BerElement *ber, ber_len_t * 2) primitive encodings used whenever possible */ + *len = 0; + /* * First, we read the tag. */ @@ -110,8 +112,6 @@ ber_skip_tag( BerElement *ber, ber_len_t * greater than what we can hold in a ber_len_t. */ - *len = 0; - if ( ber_read( ber, (char *) &lc, 1 ) != 1 ) return( LBER_DEFAULT ); @@ -149,6 +149,8 @@ ber_peek_tag( assert( ber_in != NULL ); assert( BER_VALID( ber_in ) ); + *len = 0; + ber = ber_dup( ber_in ); if( ber == NULL ) {