[evolution] Crash on paste of a vCard into a message composer body
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Crash on paste of a vCard into a message composer body
- Date: Wed, 21 Dec 2016 10:41:55 +0000 (UTC)
commit 960890f1babaed48216fc0e93871dc0fe9683a12
Author: Milan Crha <mcrha redhat com>
Date: Wed Dec 21 11:36:22 2016 +0100
Crash on paste of a vCard into a message composer body
This had been reported downstream as:
https://bugzilla.redhat.com/show_bug.cgi?id=1406510
Copying (right click Copy) a contact from the Contacts page and
the trying to Paste into the body of a new email message, causes
a crash in webkit_editor_paste_clipboard_targets_cb().
src/e-util/e-html-editor-actions.c | 3 +++
src/modules/webkit-editor/e-webkit-editor.c | 5 ++++-
2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/e-util/e-html-editor-actions.c b/src/e-util/e-html-editor-actions.c
index f0649e6..9fb9b0f 100644
--- a/src/e-util/e-html-editor-actions.c
+++ b/src/e-util/e-html-editor-actions.c
@@ -555,6 +555,9 @@ clipboard_text_received_for_paste_as_text (GtkClipboard *clipboard,
{
EContentEditor *cnt_editor;
+ if (!text || !*text)
+ return;
+
cnt_editor = e_html_editor_get_content_editor (editor);
e_content_editor_insert_content (
cnt_editor,
diff --git a/src/modules/webkit-editor/e-webkit-editor.c b/src/modules/webkit-editor/e-webkit-editor.c
index 4dbd878..43cc223 100644
--- a/src/modules/webkit-editor/e-webkit-editor.c
+++ b/src/modules/webkit-editor/e-webkit-editor.c
@@ -5665,6 +5665,7 @@ webkit_editor_paste_clipboard_targets_cb (GtkClipboard *clipboard,
webkit_editor_insert_image (E_CONTENT_EDITOR (wk_editor), uri);
+ g_free (content);
g_free (uri);
return;
@@ -5676,8 +5677,10 @@ webkit_editor_paste_clipboard_targets_cb (GtkClipboard *clipboard,
/* Prefer plain text over HTML when in the plain text mode, but only
* when pasting content from outside the editor view. */
- if (!content && !*content)
+ if (!content || !*content) {
+ g_free (content);
return;
+ }
if (is_html)
webkit_editor_insert_content (
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]