Subject: fetchmail: segfaults if bsmtp file can't be opened Package: fetchmail Version: 6.3.6-1 Severity: normal
fetchmail segfaults if the specified bsmtp file can't be opened (e.g. if it the parent folder doesn't exist). * fetchmail manpage | bsmtp -o Specify BSMTP batch file to | append I compiled fetchmail with debug symbols and I think I found the location of the bug. sink.c: 706 if (strcmp(ctl->bsmtp, "-") == 0) 707 sinkfp = stdout; 708 else 709 sinkfp = fopen(ctl->bsmtp, "a"); 710 711 /* see the ap computation under the SMTP branch */ 712 need_anglebrs = (msg->return_path[0] != '<'); 713 fprintf(sinkfp, 714 "MAIL FROM:%s%s%s", 715 need_anglebrs ? "<" : "", 716 (msg->return_path[0]) ? msg->return_path : user, 717 need_anglebrs ? ">" : ""); I guess fetchmail should check if the open was successful :). Program received signal SIGSEGV, Segmentation fault. 0xb7c83629 in vfprintf () from /lib/tls/i686/cmov/libc.so.6 (gdb) bt #0 0xb7c83629 in vfprintf () from /lib/tls/i686/cmov/libc.so.6 #1 0xb7c8c212 in fprintf () from /lib/tls/i686/cmov/libc.so.6 #2 0x0805c31e in open_sink (ctl=0x8090688, msg=0x8087800, good_addresses=0xbfddcd9c, bad_addresses=0xbfddcd98) at sink.c:713 #3 0x08059b72 in readheaders (sock=6, fetchlen=2057, reallen=3795, ctl=0x8090688, num=3, suppress_readbody=0x0) at transact.c:1151 #4 0x08056682 in do_session (ctl=0x8090688, proto=0x807d000, maxfetch=0) at driver.c:621 #5 0x080685da in doIMAP (ctl=0x8090688) at imap.c:1302 #6 0x0804e87b in query_host (ctl=0x8090688) at fetchmail.c:1480 #7 0x0804f4de in main (argc=1095565372, argv=0xbfde10d4) at fetchmail.c:739 Regards, Reto Schüttel -- System Information: Debian Release: 4.0 APT prefers testing APT policy: (500, 'testing') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.18-4-686 Locale: LANG=C, LC_CTYPE=C (charmap=ISO-8859-1) (ignored: LC_ALL set to de_CH.iso88591) Versions of packages fetchmail depends on: ii adduser 3.102 Add and remove users and groups ii debianutils 2.17 Miscellaneous utilities specific t ii libc6 2.3.6.ds1-13 GNU C Library: Shared libraries ii libssl0.9.8 0.9.8c-4 SSL shared libraries ii lsb-base 3.1-23.1 Linux Standard Base 3.1 init scrip Versions of packages fetchmail recommends: ii ca-certificates 20070303 Common CA Certificates PEM files -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]