Reto Schuettel <[EMAIL PROTECTED]> writes:
> fetchmail aborts all attempts to download messages from a mailserver
> with a 'socket error'.
> ... I'm not sure, but it seems like author swaped the two args size and nmemb
> by accident, so instead of writing N elements with the size 1 he writes
> ONE elment with size N :).
Indeed. Unfortunately my and Reto's research of this bug that I, too,
found when testing the BSMTP SIGSEGV fix overlapped.
Anyways, patch attached.
--
Matthias Andree
Index: sink.c
===================================================================
--- sink.c (Revision 5070)
+++ sink.c (Revision 5071)
@@ -686,7 +686,7 @@
n = 0;
if (ctl->mda || ctl->bsmtp) {
- n = fwrite(buf, last - buf, 1, sinkfp);
+ n = fwrite(buf, 1, last - buf, sinkfp);
if (ferror(sinkfp)) n = -1;
} else if (ctl->smtp_socket != -1)
n = SockWrite(ctl->smtp_socket, buf, last - buf);