talons

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

commit 4228ee62e4b793eb7ee536b8eb386a8b272af540
parent b3e01e3b340b1a2ced8bd50e1b8eaea9eb5dabdf
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 @@ -431,8 +431,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))) {