version 1.34.6.8, 2001/11/06 16:49:17
|
version 1.34.6.9, 2001/12/04 18:49:15
|
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.7 2001/05/06 19:53:57 kurt Exp $ */ |
/* $OpenLDAP: pkg/ldap/libraries/liblber/decode.c,v 1.34.6.8 2001/11/06 16:49:17 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 585 ber_scanf ( BerElement *ber,
|
Line 585 ber_scanf ( BerElement *ber,
|
tag != LBER_DEFAULT && rc != LBER_DEFAULT; |
tag != LBER_DEFAULT && rc != LBER_DEFAULT; |
tag = ber_next_element( ber, &len, last ) ) |
tag = ber_next_element( ber, &len, last ) ) |
{ |
{ |
void *save = *sss; |
char **save = *sss; |
|
|
*sss = (char **) LBER_REALLOC( *sss, |
*sss = (char **) LBER_REALLOC( *sss, |
(j + 2) * sizeof(char *) ); |
(j + 2) * sizeof(char *) ); |
|
|
if( *sss == NULL ) { |
if( *sss == NULL ) { |
LBER_FREE( save ); |
save[j] = NULL; |
|
ber_memvfree( (void **) save ); |
rc = LBER_DEFAULT; |
rc = LBER_DEFAULT; |
goto breakout; |
goto breakout; |
} |
} |
Line 599 ber_scanf ( BerElement *ber,
|
Line 600 ber_scanf ( BerElement *ber,
|
rc = ber_get_stringa( ber, &((*sss)[j]) ); |
rc = ber_get_stringa( ber, &((*sss)[j]) ); |
j++; |
j++; |
} |
} |
if ( j > 0 ) |
if ( j > 0 ) (*sss)[j] = NULL; |
(*sss)[j] = NULL; |
|
break; |
break; |
|
|
case 'V': /* sequence of strings + lengths */ |
case 'V': /* sequence of strings + lengths */ |
Line 611 ber_scanf ( BerElement *ber,
|
Line 611 ber_scanf ( BerElement *ber,
|
tag != LBER_DEFAULT && rc != LBER_DEFAULT; |
tag != LBER_DEFAULT && rc != LBER_DEFAULT; |
tag = ber_next_element( ber, &len, last ) ) |
tag = ber_next_element( ber, &len, last ) ) |
{ |
{ |
void *save = *bv; |
struct berval **save = *bv; |
|
|
*bv = (struct berval **) LBER_REALLOC( *bv, |
*bv = (struct berval **) LBER_REALLOC( *bv, |
(j + 2) * sizeof(struct berval *) ); |
(j + 2) * sizeof(struct berval *) ); |
|
|
if( *bv == NULL ) { |
if( *bv == NULL ) { |
LBER_FREE( save ); |
save[j] = NULL; |
|
ber_bvecfree( save ); |
rc = LBER_DEFAULT; |
rc = LBER_DEFAULT; |
goto breakout; |
goto breakout; |
} |
} |
Line 625 ber_scanf ( BerElement *ber,
|
Line 626 ber_scanf ( BerElement *ber,
|
rc = ber_get_stringal( ber, &((*bv)[j]) ); |
rc = ber_get_stringal( ber, &((*bv)[j]) ); |
j++; |
j++; |
} |
} |
if ( j > 0 ) |
if ( j > 0 ) (*bv)[j] = NULL; |
(*bv)[j] = NULL; |
|
break; |
break; |
|
|
case 'x': /* skip the next element - whatever it is */ |
case 'x': /* skip the next element - whatever it is */ |
Line 734 breakout:
|
Line 734 breakout:
|
case 'v': /* sequence of strings */ |
case 'v': /* sequence of strings */ |
sss = va_arg( ap, char *** ); |
sss = va_arg( ap, char *** ); |
if ( *sss ) { |
if ( *sss ) { |
for (j = 0; (*sss)[j]; j++) { |
ber_memvfree( (void **) *sss ); |
LBER_FREE( (*sss)[j] ); |
|
(*sss)[j] = NULL; |
|
} |
|
LBER_FREE( *sss ); |
|
*sss = NULL; |
*sss = NULL; |
} |
} |
break; |
break; |