Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 677882 - gnome-extra/evolution-ews-3.26.6 segmentation fault on malformed ical mime part
Summary: gnome-extra/evolution-ews-3.26.6 segmentation fault on malformed ical mime part
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-13 16:54 UTC by Liam Dennehy
Modified: 2019-02-22 18:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
ews-malformed-icalcomponent.patch (file_677882.txt,821 bytes, text/plain)
2019-02-13 16:54 UTC, Liam Dennehy
Details
Safer data handling for malformed calendar events (0001-Crash-when-meeting-invitation-iCalendar-part-could-n.patch,3.74 KB, patch)
2019-02-13 17:21 UTC, Liam Dennehy
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Liam Dennehy 2019-02-13 16:54:57 UTC
Created attachment 565054 [details]
ews-malformed-icalcomponent.patch

In some instances reconnecting to ews can cause a segfault when meeting invite (ical?) part cannot be parsed:

Thread 118 "pool" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff41ff9700 (LWP 10889)]
ews_update_mgtrequest_mime_calendar_itemid (mail_item_id=0x7fff1834d5e0, error=0x0, is_calendar_UID=1, calendar_item_id=<optimized out>, 
    mime_fname=0x7fff1826cb00 "/home/liam/.cache/evolution/mail/0302f339fb095fb2a600b3a15a174dd167151f12/folders/Inbox/mimecontent/OB8AXZ")
    at /usr/src/debug/gnome-extra/evolution-ews-3.26.6/evolution-ews-3.26.6/src/camel/camel-ews-folder.c:438
438				strlen (calstring_new),

Suggested patch derived from upstream at https://gitlab.gnome.org/GNOME/evolution-ews/commit/f497204167969702e571c1781c2440e918938895#ead8e0bfa9cbb98200d39e6ee2d4486a29f16610_442_441
Comment 1 Liam Dennehy 2019-02-13 17:19:57 UTC
Comment on attachment 565054 [details]
ews-malformed-icalcomponent.patch

>diff --git a/src/camel/camel-ews-folder.c b/src/camel/camel-ews-folder.c
>index 7d7c6d8..cf87a14 100644
>--- a/src/camel/camel-ews-folder.c
>+++ b/src/camel/camel-ews-folder.c
>@@ -432,12 +432,14 @@ ews_update_mgtrequest_mime_calendar_itemid (const gchar *mime_fname,
> 		icalcomponent_add_property (subcomp, icalprop);
> 
> 		calstring_new = icalcomponent_as_ical_string_r (icalcomp);
>-		camel_mime_part_set_content (
>-			mimepart,
>-			(const gchar *) calstring_new,
>-			strlen (calstring_new),
>-			"text/calendar");
>-		g_free (calstring_new);
>+		if (calstring_new) {
>+			camel_mime_part_set_content (
>+				mimepart,
>+				(const gchar *) calstring_new,
>+				strlen (calstring_new),
>+				"text/calendar");
>+			g_free (calstring_new);
>+		}
> 		icalcomponent_free (icalcomp);
> 		g_object_unref (tmpstream);
Comment 2 Liam Dennehy 2019-02-13 17:21:39 UTC
Created attachment 565058 [details, diff]
Safer data handling for malformed calendar events

From https://gitlab.gnome.org/GNOME/evolution-ews/commit/f4972041

Crash when meeting invitation iCalendar part could not be parsed
Comment 3 Larry the Git Cow gentoo-dev 2019-02-22 18:03:47 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1b15af91072f4f0558b5d1ebf6018bd0b952f8f

commit d1b15af91072f4f0558b5d1ebf6018bd0b952f8f
Author:     Mart Raudsepp <leio@gentoo.org>
AuthorDate: 2019-02-22 17:47:36 +0000
Commit:     Mart Raudsepp <leio@gentoo.org>
CommitDate: 2019-02-22 18:02:37 +0000

    gnome-extra/evolution-ews: bump to 3.30.5; supports Office 365
    
    Closes: https://bugs.gentoo.org/677882
    Package-Manager: Portage-2.3.52, Repoman-2.3.12
    Signed-off-by: Mart Raudsepp <leio@gentoo.org>

 gnome-extra/evolution-ews/Manifest                 |  1 +
 .../evolution-ews/evolution-ews-3.30.5.ebuild      | 65 ++++++++++++++++++++++
 2 files changed, 66 insertions(+)