Browse Source

Bug 659456 - Incorrect usage of ber_printf() in winsync code

In the winsync code, we can end up passing a NULL pointer to
ber_printf() when we want to add an octet string for the dirsync
cookie.  This causes a SIGABRT when using a debug build on F14
since you are not supposed to pass a NULL.

The fix is to pass an empty string when the cookie is NULL.
Nathan Kinder 15 years ago
parent
commit
0c40b2cc44
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ldap/servers/plugins/replication/windows_private.c

+ 1 - 1
ldap/servers/plugins/replication/windows_private.c

@@ -611,7 +611,7 @@ LDAPControl* windows_private_dirsync_control(const Repl_Agmt *ra)
 	PR_ASSERT (dp);
 	ber = 	ber_alloc();
 
-	ber_printf( ber, "{iio}", dp->dirsync_flags, dp->dirsync_maxattributecount, dp->dirsync_cookie, dp->dirsync_cookie_len );
+	ber_printf( ber, "{iio}", dp->dirsync_flags, dp->dirsync_maxattributecount, dp->dirsync_cookie ? dp->dirsync_cookie : "", dp->dirsync_cookie_len );
 
 	/* Use a regular directory server instead of a real AD - for testing */
 	if (getenv("WINSYNC_USE_DS")) {