Patch: fix bad reusage of namespaces pointer in camel imap store
- From: José Dapena Paz <jdapena igalia com>
- To: tinymail-devel-list <tinymail-devel-list gnome org>
- Subject: Patch: fix bad reusage of namespaces pointer in camel imap store
- Date: Mon, 16 Feb 2009 10:52:09 +0100
Hi,
This patch should fix the problems reusing the namespace pointer in
camel imap store. We were using (just for laziness I guess) a simple
pointer to the namespace pointer in imap_store, but as the namespace can
change on disconnection, we were likely to access the old pointer.
So, to avoid this, pragmatic solution, just use always the full pointer
path instead of "shortcuts".
Changelog entry:
* libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c:
fix bad access to namespaces due to bad reusage of pointer
--
José Dapena Paz <jdapena igalia com>
Igalia
diff --git a/ChangeLog b/ChangeLog
index 363e464..c994359 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2009-02-16 Jose Dapena Paz <jdapena igalia com>
+ * libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c:
+ fix bad access to namespaces due to bad reusage of pointer.
+
* libtinymail-camel/camel-lite/camel/camel-mime-utils.c: fix
camel_header_set_param as it could cause crashes on setting params
if a param struct was already available.
diff --git a/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c b/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
index f8f94b1..d54b69e 100644
--- a/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
+++ b/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
@@ -4213,7 +4213,6 @@ get_folder_info_online (CamelStore *store, const char *top, guint32 flags, Camel
if (imap_store->namespaces && imap_store->capabilities & IMAP_CAPABILITY_NAMESPACE)
{
- struct _namespaces *ns = imap_store->namespaces;
char delim = '.';
gboolean has_d = FALSE;
@@ -4225,15 +4224,14 @@ get_folder_info_online (CamelStore *store, const char *top, guint32 flags, Camel
if (camel_exception_is_set(ex))
goto fail;*/
- if (ns->personal) {
- get_folders_sync_ns (imap_store, ns->personal,
- (gboolean) ns->other,
- (gboolean) ns->shared, ex);
- ns = imap_store->namespaces;
- if (ns->personal) {
- delim = ns->personal->delim;
+ if (imap_store->namespaces->personal) {
+ get_folders_sync_ns (imap_store, imap_store->namespaces->personal,
+ (gboolean) imap_store->namespaces->other,
+ (gboolean) imap_store->namespaces->shared, ex);
+ if (imap_store->namespaces->personal) {
+ delim = imap_store->namespaces->personal->delim;
has_d = TRUE;
- if (g_ascii_strncasecmp (ns->personal->prefix, "INBOX", 5) == 0) {
+ if (g_ascii_strncasecmp (imap_store->namespaces->personal->prefix, "INBOX", 5) == 0) {
get_folders_sync (imap_store, "%", ex);
}
}
@@ -4250,17 +4248,15 @@ get_folder_info_online (CamelStore *store, const char *top, guint32 flags, Camel
* character. (recursively fetching alt.* of NNTP is not a
* very good idea nowadays...) */
- if (ns->other) {
- get_folders_sync_ns_only_lsub (imap_store, ns->other, ex);
- ns = imap_store->namespaces;
+ if (imap_store->namespaces->other) {
+ get_folders_sync_ns_only_lsub (imap_store, imap_store->namespaces->other, ex);
}
if (camel_exception_is_set(ex))
goto fail;
- if (ns->shared) {
- get_folders_sync_ns_only_lsub (imap_store, ns->shared, ex);
- ns = imap_store->namespaces;
+ if (imap_store->namespaces->shared) {
+ get_folders_sync_ns_only_lsub (imap_store, imap_store->namespaces->shared, ex);
}
if (camel_exception_is_set(ex))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]