diff options
author | Chris Toshok <toshok@ximian.com> | 2001-07-18 10:11:23 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2001-07-18 10:11:23 +0800 |
commit | a72b3b2245ff0aaf6bd35cd229357e5aec4378ad (patch) | |
tree | dde55b7ff00bac4ed73353e31694e19a40dd0fae /addressbook | |
parent | 0e03733290dff59622b64fc332d75f9c217ec2b8 (diff) | |
download | gsoc2013-evolution-a72b3b2245ff0aaf6bd35cd229357e5aec4378ad.tar.gz gsoc2013-evolution-a72b3b2245ff0aaf6bd35cd229357e5aec4378ad.tar.zst gsoc2013-evolution-a72b3b2245ff0aaf6bd35cd229357e5aec4378ad.zip |
[ Fixes bugs #4611 - crash searching in the name field at Bigfoot for "\"
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.
svn path=/trunk/; revision=11192
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 13 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-backend-ldap.c | 18 |
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); |