ITS#1924 use GENERAL_NAMES_free instead of ext_free.

This commit is contained in:
Howard Chu 2002-07-05 21:59:02 +00:00
parent 62139b6ef3
commit 07ffaeaac8
2 changed files with 6 additions and 4 deletions

View file

@ -161,12 +161,16 @@ sb_sasl_pkt_length( const unsigned char *buf, unsigned max, int debuglevel )
| buf[2] << 8
| buf[3];
if ( size > max ) {
if ( size > SASL_MAX_BUFF_SIZE ) {
/* somebody is trying to mess me up. */
ber_log_printf( LDAP_DEBUG_ANY, debuglevel,
"sb_sasl_pkt_length: received illegal packet length "
"of %lu bytes\n", (unsigned long)size );
size = 16; /* this should lead to an error. */
} else if ( size > max ) {
ber_log_printf( LDAP_DEBUG_ANY, debuglevel,
"sb_sasl_pkt_length: received packet length "
"of %lu exceeds negotiated max of %lu bytes\n", (unsigned long)size, (unsigned long)max );
}
return size + 4; /* include the size !!! */

View file

@ -953,7 +953,6 @@ ldap_pvt_tls_check_hostname( void *s, const char *name_in )
int n, len1, len2 = 0;
char *domain;
GENERAL_NAME *gn;
X509V3_EXT_METHOD *method;
len1 = strlen(name);
n = sk_GENERAL_NAME_num(alt);
@ -990,8 +989,7 @@ ldap_pvt_tls_check_hostname( void *s, const char *name_in )
}
}
method = X509V3_EXT_get(ex);
method->ext_free(alt);
GENERAL_NAMES_free(alt);
if (i < n) { /* Found a match */
ret = LDAP_SUCCESS;
}