浏览代码

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 年之前
父节点
当前提交
0c40b2cc44
共有 1 个文件被更改,包括 1 次插入1 次删除
  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")) {