talons

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

commit 68b65ac49c4d51ef855fd65e2a9206e528190a82
parent 263eb81335dd2052f10d7d6fd94f4810e085605a
Author: wwp <subscript@free.fr>
Date:   Thu,  7 Oct 2021 09:14:02 +0200

Fix CID 1491311: dereference after null check.
Wrong logic there: we should fail if pointers are null, not only if strings are empty,
even though gtk_entry_get_text should never return null).

Diffstat:
Msrc/export.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/export.c b/src/export.c @@ -201,12 +201,12 @@ static void export_ok_cb(GtkWidget *widget, gpointer data) srcdir = gtk_entry_get_text(GTK_ENTRY(src_entry)); utf8mbox = gtk_entry_get_text(GTK_ENTRY(file_entry)); - if (utf8mbox && !*utf8mbox) { + if (!utf8mbox || !*utf8mbox) { alertpanel_error(_("Target mbox filename can't be left empty.")); gtk_widget_grab_focus(file_entry); return; } - if (srcdir && !*srcdir) { + if (!srcdir || !*srcdir) { alertpanel_error(_("Source folder can't be left empty.")); gtk_widget_grab_focus(src_entry); return;