On Fr, 2011-07-08 at 18:09 +0200, Patrick Ohly wrote:
> I am seeing some issues with sync key handling. In some cases, the
> activesyncd debug output shows random characters. That looks very much
> like an invalid memory access.
>
> I had a brief look into eas_sync_handler_get_items(), but only found a
> memory leak:
> sync_key_in = g_strdup("0");
> has no corresponding g_free().
The invalid memory access occurs when trying to print the new sync key
after a failure to obtain one. Potential segfault. Fix attached, also
for the g_strdup("0").
Andy, please review and apply.
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
diff --git a/libeassync/src/libeassync.c b/libeassync/src/libeassync.c
index 277ff38..1e7c1f2 100644
--- a/libeassync/src/libeassync.c
+++ b/libeassync/src/libeassync.c
@@ -209,7 +209,7 @@ gboolean eas_sync_handler_get_items (EasSyncHandler* self,
if(sync_key_in ==NULL||(strlen(sync_key_in)<=0))
{
g_debug ("updating sync key to 0");
- sync_key_in = g_strdup("0");
+ sync_key_in = "0";
}
@@ -283,9 +283,9 @@ gboolean eas_sync_handler_get_items (EasSyncHandler* self,
g_slist_foreach (*items_deleted, (GFunc) g_free, NULL);
g_free (*items_deleted);
*items_deleted = NULL;
- }
+ } else {
g_debug("sync_key = %s", *sync_key_out);
-
+ }
g_debug ("eas_sync_handler_get_items--");
return ret;
_______________________________________________
SyncEvolution mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution