[neomutt-devel] Crash on authentication fail at startup

Jules Maselbas jmaselbas at kalray.eu
Thu May 2 10:11:34 CEST 2019


Hi,

When neomutt start it ask for my imap password however neomutt crashes
if the password is empty or if the authentication fails.

You can find a simple fix that check for null account data in imap_ac_find.
But I doubt that this is the only place where this extra check is needed.
I also hope there is a better solution than adding more and more checks.

Best regards

---
Jules

--- Output: ---
Password for username at mail.com:
Program received signal SIGSEGV, Segmentation fault.
(gdb) bt
0x00007ffff67bc3f5 in __strcasecmp_l_avx () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.4.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-37.el7_6.x86_64 libcom_err-1.42.9-13.el7.x86_64 libidn-1.28-4.el7.x86_64 libsel\
inux-2.5-14.1.el7.x86_64 lmdb-libs-0.9.22-2.el7.x86_64 ncurses-libs-5.9-14.20130511.el7_4.x86_64 openssl-libs-1.0.2k-16.el7_6.1.x86_64 pcre-8.32-17.el7.x86_64 sssd-client-1.16.2-13.el7_6.5.x86_64 zlib-1.2.7-18.e\
l7.x86_64
(gdb) bt
#0  0x00007ffff67bc3f5 in __strcasecmp_l_avx () from /lib64/libc.so.6
#1  0x000000000049bd71 in imap_ac_find (a=0x898b00, path=<optimized out>) at imap/imap.c:1831
#2  0x000000000044bdd3 in mx_ac_find (m=0x89b2d0) at mx.c:1458
#3  0x00000000004377a7 in parse_mailboxes (buf=0x7fffffffab50, s=0x7fffffffaaa0, data=<optimized out>, err=<optimized out>) at init.c:1344
#4  0x000000000043867f in mutt_parse_rc_line (line=<optimized out>, token=token at entry=0x7fffffffab50, err=err at entry=0x7fffffffbc00) at init.c:3280
#5  0x0000000000438965 in mutt_parse_rc_line (err=0x7fffffffbc00, token=0x7fffffffab50, line=<optimized out>) at init.c:820
#6  source_rc (rcfile_path=<optimized out>, err=err at entry=0x7fffffffbc00) at init.c:822
#7  0x000000000043963d in mutt_init (skip_sys_rc=<optimized out>, commands=commands at entry=0x7fffffffc6c0) at init.c:3179
#8  0x0000000000407cb4 in main (argc=1, argv=<optimized out>, envp=<optimized out>) at main.c:693
------------------------------------------
NeoMutt 20180716-1557-a6ba22
System: Linux 3.10.0-957.10.1.el7.x86_64 (x86_64)
ncurses: ncurses 5.9.20130511 (compiled with 5.9.20130511)
libidn: 1.28 (compiled with 1.28)
hcache backends: lmdb
cc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
------------------------------------------
diff --git a/imap/imap.c b/imap/imap.c
index 60c3b3e94..d1d89fb84 100644
--- a/imap/imap.c
+++ b/imap/imap.c
@@ -1820,7 +1820,7 @@ int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close)
  */
 struct Account *imap_ac_find(struct Account *a, const char *path)
 {
-  if (!a || (a->magic != MUTT_IMAP) || !path)
+  if (!a || (a->magic != MUTT_IMAP) || !path || !a->adata)
     return NULL;



More information about the neomutt-devel mailing list