version 1.34.6.4, 2000/07/29 01:53:07
|
version 1.34.6.5, 2000/10/02 17:26:31
|
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.34.6.3 2000/06/13 17:57:17 kurt Exp $ */ |
/* $OpenLDAP: pkg/ldap/libraries/liblber/decode.c,v 1.34.6.4 2000/07/29 01:53:07 kurt Exp $ */ |
/* |
/* |
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. |
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. |
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file |
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file |
Line 297 ber_get_stringal( BerElement *ber, struc
|
Line 297 ber_get_stringal( BerElement *ber, struc
|
|
|
if ( (tag = ber_skip_tag( ber, &len )) == LBER_DEFAULT ) { |
if ( (tag = ber_skip_tag( ber, &len )) == LBER_DEFAULT ) { |
*bv = NULL; |
*bv = NULL; |
return( LBER_DEFAULT ); |
return LBER_DEFAULT; |
} |
} |
|
|
if ( (*bv = (struct berval *) LBER_MALLOC( sizeof(struct berval) )) == NULL ) |
*bv = (struct berval *) LBER_MALLOC( sizeof(struct berval) ); |
return( LBER_DEFAULT ); |
if ( *bv == NULL ) { |
|
return LBER_DEFAULT; |
|
} |
|
|
if ( ((*bv)->bv_val = (char *) LBER_MALLOC( len + 1 )) == NULL ) { |
if( len == 0 ) { |
|
(*bv)->bv_val = NULL; |
|
(*bv)->bv_len = 0; |
|
return tag; |
|
} |
|
|
|
(*bv)->bv_val = (char *) LBER_MALLOC( len + 1 ); |
|
if ( (*bv)->bv_val == NULL ) { |
LBER_FREE( *bv ); |
LBER_FREE( *bv ); |
*bv = NULL; |
*bv = NULL; |
return( LBER_DEFAULT ); |
return LBER_DEFAULT; |
} |
} |
|
|
if ( (ber_len_t) ber_read( ber, (*bv)->bv_val, len ) != len ) { |
if ( (ber_len_t) ber_read( ber, (*bv)->bv_val, len ) != len ) { |
ber_bvfree( *bv ); |
ber_bvfree( *bv ); |
*bv = NULL; |
*bv = NULL; |
return( LBER_DEFAULT ); |
return LBER_DEFAULT; |
} |
} |
|
|
((*bv)->bv_val)[len] = '\0'; |
((*bv)->bv_val)[len] = '\0'; |
(*bv)->bv_len = len; |
(*bv)->bv_len = len; |
|
|