aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog13
-rw-r--r--addressbook/backend/pas/pas-backend-ldap.c18
2 files changed, 25 insertions, 6 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 480df273e7..81b7583ce4 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,16 @@
+2001-07-17 Chris Toshok <toshok@ximian.com>
+
+ [ Fixes bugs #4611 - crash searching in the name field at Bigfoot for "\"
+ and #4554 - general ldap search crash ]
+
+ * backend/pas/pas-backend-ldap.c (func_contains): the length of
+ the big query string needs to take into account the length of the
+ footer as well as the header - fix random memory corruption here.
+
+ * backend/pas/pas-backend-ldap.c (pas_backend_ldap_build_query):
+ list can be NULL, specifically if there's a parsing error in the
+ sexp, so deal with it.
+
2001-07-17 Jon Trowbridge <trow@ximian.com>
* backend/ebook/e-book-view-listener.c
diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c
index e1312ee5b9..056e56f28f 100644
--- a/addressbook/backend/pas/pas-backend-ldap.c
+++ b/addressbook/backend/pas/pas-backend-ldap.c
@@ -1552,7 +1552,7 @@ func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
match_str = g_strdup_printf("=*%s%s)",
str, one_star ? "" : "*");
- query_length = strlen (header);
+ query_length = strlen (header) + strlen (footer);
for (i = 0; i < num_prop_infos; i ++) {
query_length += 1 + strlen(prop_info[i].ldap_attr) + strlen (match_str);
@@ -1727,13 +1727,19 @@ pas_backend_ldap_build_query (gchar *query)
e_sexp_result_free(sexp, r);
e_sexp_unref (sexp);
- if (list->next) {
- g_warning ("conversion to ldap query string failed");
- retval = NULL;
- g_list_foreach (list, (GFunc)g_free, NULL);
+ if (list) {
+ if (list->next) {
+ g_warning ("conversion to ldap query string failed");
+ retval = NULL;
+ g_list_foreach (list, (GFunc)g_free, NULL);
+ }
+ else {
+ retval = list->data;
+ }
}
else {
- retval = list->data;
+ g_warning ("conversion to ldap query string failed");
+ retval = NULL;
}
g_list_free (list);