commit 286e63ec8361b7f195925ab1854c2227416d3a56
parent 00d8211caa63bdb27e881c063f7684e88594e47e
Author: wwp <subscript@free.fr>
Date: Wed, 29 Sep 2021 12:43:22 +0200
Fix CID 1491362: dereference after null check.
Fix CID 1491278: (neutral) use after free (but still better to disable callbacks before freeing).
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/plugins/managesieve/sieve_editor.c b/src/plugins/managesieve/sieve_editor.c
@@ -164,7 +164,7 @@ static void sieve_editor_append_status(SieveEditorPage *page,
GtkLabel *label = GTK_LABEL(page->status_text);
const gchar *prev_status = gtk_label_get_text(label);
const gchar *sep = prev_status && prev_status[0] ? "\n" : "";
- gchar *status = g_strconcat(prev_status, sep, new_status, NULL);
+ gchar *status = g_strconcat(prev_status ? prev_status : "", sep, new_status, NULL);
gtk_label_set_text(label, status);
g_free(status);
}
@@ -422,8 +422,8 @@ static void sieve_editor_destroy(SieveEditorPage *page)
void sieve_editor_close(SieveEditorPage *page)
{
editors = g_slist_remove(editors, (gconstpointer)page);
- sieve_editor_destroy(page);
sieve_sessions_discard_callbacks(page);
+ sieve_editor_destroy(page);
}
static gboolean sieve_editor_confirm_close(SieveEditorPage *page)