talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit e3048e92f12db05a9e18328f72acd14094e3f97f
parent 45c87cf44dae2b33714bf7af487fb07fbc099bff
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:
Msrc/plugins/managesieve/sieve_editor.c | 4++--
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)