Diff for /libraries/liblber/decode.c between versions 1.41 and 1.42

version 1.41, 1999/11/08 14:43:12 version 1.42, 1999/11/08 18:36:30
Line 1 Line 1
 /* decode.c - ber input decoding routines */  /* decode.c - ber input decoding routines */
 /* $OpenLDAP: pkg/ldap/libraries/liblber/decode.c,v 1.40 1999/11/08 14:39:00 kdz Exp $ */  /* $OpenLDAP: pkg/ldap/libraries/liblber/decode.c,v 1.39 1999/10/19 16:57:39 kdz Exp $ */
 /*  /*
  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.   * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file   * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
Line 135  ber_peek_tag( Line 135  ber_peek_tag(
         BerElement *ber_in,          BerElement *ber_in,
         ber_len_t *len )          ber_len_t *len )
 {  {
         char*   save;          ber_tag_t       tag;
         BerElement *ber;          BerElement *ber;
         ber_tag_t tag;  
   
         assert( ber_in != NULL );          assert( ber_in != NULL );
         assert( BER_VALID( ber_in ) );          assert( BER_VALID( ber_in ) );
   
         /* save state */          ber = ber_dup( ber_in );
         save = ber->ber_ptr;  
   
         tag = ber_skip_tag( ber, len );          if( ber == NULL ) {
                   return LBER_ERROR;
           }
   
         /* restore state */          assert( BER_VALID( ber ) );
         ber->ber_ptr = save;  
   
           tag = ber_skip_tag( ber, len );
   
           ber_free( ber, 0 );
         return( tag );          return( tag );
 }  }
   
Line 451  ber_first_element( Line 453  ber_first_element(
   
         /* skip the sequence header, use the len to mark where to stop */          /* skip the sequence header, use the len to mark where to stop */
         if ( ber_skip_tag( ber, len ) == LBER_DEFAULT ) {          if ( ber_skip_tag( ber, len ) == LBER_DEFAULT ) {
                 return( LBER_ERROR );                  *last = NULL;
                   return( LBER_DEFAULT );
         }          }
   
         *last = ber->ber_ptr + *len;          *last = ber->ber_ptr + *len;
Line 476  ber_next_element( Line 479  ber_next_element(
         assert( BER_VALID( ber ) );          assert( BER_VALID( ber ) );
   
         if ( ber->ber_ptr == last ) {          if ( ber->ber_ptr == last ) {
                 /* set last to NULL on end of SEQUENCE */  
                 return( LBER_DEFAULT );                  return( LBER_DEFAULT );
         }          }
   

Removed from v.1.41  
changed lines
  Added in v.1.42


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org