From cae9ec7a87f7ea68b082881c31831e774e2bf0f1 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 10 Jul 2002 03:24:37 +0000 Subject: [PATCH] Fix bufsiz issues --- libraries/libldap/cyrus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index 06d275eeb4..f215b752e1 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -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 !!! */ -- 2.39.5