[389-commits] 3 commits - ldap/servers
Richard Allen Megginson
rmeggins at fedoraproject.org
Fri Feb 26 18:19:44 UTC 2010
ldap/servers/plugins/syntaxes/bin.c | 2 +-
ldap/servers/plugins/syntaxes/string.c | 6 +++---
ldap/servers/slapd/entrywsi.c | 4 +++-
3 files changed, 7 insertions(+), 5 deletions(-)
New commits:
commit 9c0edff0cffc5d5aa62b4edb74133008b72b8e94
Author: Rich Megginson <rmeggins at redhat.com>
Date: Thu Feb 25 20:29:35 2010 -0700
389 DS segfaults on libsyntax-plugin.so - part 3
https://bugzilla.redhat.com/show_bug.cgi?id=516611
Resolves: bug 516611
Bug Description: 389 DS segfaults on libsyntax-plugin.so - part 3
Reviewed by: nkinder (Thanks!)
Branch: HEAD
Fix Description: bin_filter_ava should check for null bvals
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/syntaxes/bin.c b/ldap/servers/plugins/syntaxes/bin.c
index 3d2d88a..25f2129 100644
--- a/ldap/servers/plugins/syntaxes/bin.c
+++ b/ldap/servers/plugins/syntaxes/bin.c
@@ -251,7 +251,7 @@ bin_filter_ava( Slapi_PBlock *pb, struct berval *bvfilter,
{
int i;
- for ( i = 0; bvals[i] != NULL; i++ ) {
+ for ( i = 0; (bvals != NULL) && (bvals[i] != NULL); i++ ) {
const struct berval *bv = slapi_value_get_berval(bvals[i]);
int rc = slapi_berval_cmp(bv, bvfilter);
commit 38d13f961c0d8033aa3dd3e5a3a8f32bc1650691
Author: Rich Megginson <rmeggins at redhat.com>
Date: Thu Feb 25 19:07:25 2010 -0700
389 DS segfaults on libsyntax-plugin.so - part 2
https://bugzilla.redhat.com/show_bug.cgi?id=516611
Resolves: bug 516611
Bug Description: 389 DS segfaults on libsyntax-plugin.so - part 2
Reviewed by: nkinder (Thanks!)
Branch: HEAD
Fix Description: If there is an empty mod/replace of a non-existent attribute
following a real modify operation, the server will allow it, and the code in
entry_delete_present_values_wsi() would create an empty Slapi_Attr. LDAP
says that an empty mod/replace of a non-existent attribute should be ignored,
as it is in the non-repl case.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
index 5fcb30d..14ff163 100644
--- a/ldap/servers/slapd/entrywsi.c
+++ b/ldap/servers/slapd/entrywsi.c
@@ -646,7 +646,9 @@ entry_delete_present_values_wsi(Slapi_Entry *e, const char *type, struct berval
LDAPDebug( LDAP_DEBUG_ARGS, "could not find attribute %s\n", type, 0, 0 );
}
retVal= LDAP_NO_SUCH_ATTRIBUTE;
- if (LDAP_MOD_REPLACE == mod_op)
+ /* NOTE: LDAP says that a MOD REPLACE with no vals of a non-existent
+ attribute is a no-op - MOD REPLACE with some vals will add the attribute */
+ if ((LDAP_MOD_REPLACE == mod_op) && vals && vals[0])
{
/* Create a new attribute and set the adcsn */
Slapi_Attr *a = slapi_attr_new();
commit ea0cdc6ce1cf1c9a690acab443e6df11b3e0fe15
Author: Rich Megginson <rmeggins at redhat.com>
Date: Thu Feb 25 10:03:52 2010 -0700
389 DS segfaults on libsyntax-plugin.so - part 1
https://bugzilla.redhat.com/show_bug.cgi?id=516611
Resolves: bug 516611
Bug Description: 389 DS segfaults on libsyntax-plugin.so - part 1
Reviewed by: nkinder (Thanks!)
Branch: HEAD
Fix Description: Check for NULL bvals in the string syntax filter functions
ava, sub, and key generation
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/syntaxes/string.c b/ldap/servers/plugins/syntaxes/string.c
index c2f0fa6..ad607dc 100644
--- a/ldap/servers/plugins/syntaxes/string.c
+++ b/ldap/servers/plugins/syntaxes/string.c
@@ -77,7 +77,7 @@ string_filter_ava( struct berval *bvfilter, Slapi_Value **bvals, int syntax,
value_normalize( bvfilter_norm.bv_val, syntax, 1 /* trim leading blanks */ );
bvfilter_norm.bv_len = strlen(bvfilter_norm.bv_val);
- for ( i = 0; bvals[i] != NULL; i++ ) {
+ for ( i = 0; (bvals != NULL) && (bvals[i] != NULL); i++ ) {
rc = value_cmp( (struct berval*)slapi_value_get_berval(bvals[i]), &bvfilter_norm, syntax, 1/* Normalise the first value only */ );
switch ( ftype ) {
case LDAP_FILTER_GE:
@@ -135,7 +135,7 @@ string_filter_approx( struct berval *bvfilter, Slapi_Value **bvals,
if(retVal) {
*retVal = NULL;
}
- for ( i = 0; bvals[i] != NULL; i++ ) {
+ for ( i = 0; (bvals != NULL) && (bvals[i] != NULL); i++ ) {
w2 = (char*)slapi_value_get_string(bvals[i]); /* JCM cast */
ava_wordcount = 0;
/* for each word in the filter value */
@@ -310,7 +310,7 @@ string_filter_sub( Slapi_PBlock *pb, char *initial, char **any, char *final,
rc = -1;
tmpbuf = NULL;
tmpbufsize = 0;
- for ( j = 0; bvals[j] != NULL; j++ ) {
+ for ( j = 0; (bvals != NULL) && (bvals[j] != NULL); j++ ) {
int tmprc;
size_t len;
const struct berval *bvp = slapi_value_get_berval(bvals[j]);
More information about the 389-commits
mailing list