talons

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

commit bac407684aa94e3d41464ceb0596f41efc0b8440
parent 17bc6d54f0b984de39badbccb4024bbedcdbfce8
Author: wwp <subscript@free.fr>
Date:   Wed,  6 Oct 2021 09:49:27 +0200

Fix CID 1492202: dereference before null check (we usually test if gtk_editable_get_chars
returns NULL, but it should not).

Diffstat:
Msrc/edittags.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/edittags.c b/src/edittags.c @@ -434,8 +434,10 @@ static gboolean find_tag_in_store(GtkTreeModel *model, static void tags_window_add_tag(void) { gchar *new_tag = gtk_editable_get_chars(GTK_EDITABLE(tagswindow.add_entry), 0, -1); + if (!new_tag) + return; g_strstrip(new_tag); - if (new_tag && *new_tag) { + if (*new_tag) { gint id; FindTagInStore fis; if (!(IS_NOT_RESERVED_TAG(new_tag))) {