talons

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

commit 9869b88395d4977eea4773953b41d337b7994949
parent 03565af05e5079d02c31202976a4f926ccd64a4b
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 @@ -194,12 +194,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;