소스 검색

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")) {