浏览代码

Resolves: 459433
Summray: MMR: intensive conflict test crashes the server
Description: values2keys functions in the syntax plugin did not check the
existence of the input and output variable.

Noriko Hosoi 17 年之前
父节点
当前提交
c8bfd0cd85
共有 2 个文件被更改,包括 14 次插入3 次删除
  1. 8 0
      ldap/servers/plugins/syntaxes/bin.c
  2. 6 3
      ldap/servers/plugins/syntaxes/string.c

+ 8 - 0
ldap/servers/plugins/syntaxes/bin.c

@@ -186,6 +186,14 @@ bin_values2keys( Slapi_PBlock *pb, Slapi_Value **bvals,
 {
 	int	i;
 
+	if (NULL == ivals) {
+		return 1;
+	}
+	*ivals = NULL;
+	if (NULL == bvals) {
+		return 1;
+	}
+
 	if ( ftype != LDAP_FILTER_EQUALITY ) {
 		return( LDAP_PROTOCOL_ERROR );
 	}

+ 6 - 3
ldap/servers/plugins/syntaxes/string.c

@@ -357,9 +357,12 @@ string_values2keys( Slapi_PBlock *pb, Slapi_Value **bvals,
 	Slapi_Value **bvlp;
 	char		*w, *c, *p;
 
+	if (NULL == ivals) {
+		return 1;
+	}
+	*ivals = NULL;
 	if (NULL == bvals) {
-		*ivals = NULL;
-		return 0;
+		return 1;
 	}
 
 	switch ( ftype ) {
@@ -435,7 +438,7 @@ string_values2keys( Slapi_PBlock *pb, Slapi_Value **bvals,
  		 * nsSubStrEnd: 2
  		 * [...]
  		 * 
- 		 * By default, begin == 2, middle == 3, end == 2 (defined in syntax.h)
+ 		 * By default, begin == 3, middle == 3, end == 3 (defined in syntax.h)
 		 */
 
 		/* If nsSubStrLen is specified in each index entry,