[Date Prev][Date Next] [Chronological] [Thread] [Top]

unitialized ber_debug in cache code (ITS#1501)



Full_Name: Will Day
Version: 2.0.19
OS: Solaris 8
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (24.98.128.121)


Setting a log-print function when the cache code is enabled creates lots of
"ber_debug" messages, even when the debug level is specified as 0.
This appears to be because the debug level isn't set in the ber created for the
cache check.
Setting the ber_debug is probably sufficient for this particular problem, but I
put in the memset to make sure any other fields are initialized to some known
value.


diff -u ./openldap-2.0.19/libraries/libldap/cache.c.orig
./openldap-2.0.19/libraries/libldap/cache.c
--- ./openldap-2.0.19/libraries/libldap/cache.c.orig	Fri Jul 28 21:53:08 2000
+++ ./openldap-2.0.19/libraries/libldap/cache.c	Thu Dec 20 12:31:08 2001
@@ -387,9 +387,12 @@
 		return( -1 );
 	}
 
+	memset(&reqber, 0, sizeof(reqber));
+
 	reqber.ber_valid = LBER_VALID_BERELEMENT;
 	reqber.ber_buf = reqber.ber_ptr = request->ber_buf;
 	reqber.ber_end = request->ber_ptr;
+	reqber.ber_debug = ber_int_debug;
 
 	c_time = time( NULL );