Hi, * Reto Schuettel <[EMAIL PROTECTED]> [2007-03-29 14:21]: > 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 :).
The funny thing is that there already is a check for this but at the wrong place :) At the end of the function: 743 if (ferror(sinkfp)) 744 { 745 report(stderr, GT_("BSMTP file open or preamble write failed\n")); 746 return(PS_BSMTP); 747 } I send a patch to upstream. Thanks for your excellent bug report! Kind regards Nico -- Nico Golde - http://www.ngolde.de JAB: [EMAIL PROTECTED] - GPG: 0x73647CFF Forget about that mouse with 3/4/5 buttons, gimme a keyboard with 103/104/105 keys!
pgp5uvt5P5OwM.pgp
Description: PGP signature