2010-07-09 03:17:37 -04:00
|
|
|
$OpenBSD: patch-pop3_c,v 1.3 2010/07/09 07:17:37 sthen Exp $
|
|
|
|
--- pop3.c.orig Mon Sep 11 19:48:48 1995
|
|
|
|
+++ pop3.c Thu Jul 8 21:33:54 2010
|
2000-06-04 20:31:33 -04:00
|
|
|
@@ -67,6 +67,7 @@
|
|
|
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
+#include <netdb.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
#include "socket.h"
|
|
|
|
@@ -122,7 +123,10 @@ struct optrec *options;
|
|
|
|
|
|
|
|
/* open the socket and get the greeting */
|
|
|
|
if ((socket = Socket(servername,POP3_PORT)) < 0) {
|
|
|
|
- perror("doPOP3: socket");
|
|
|
|
+ if (socket == -2)
|
|
|
|
+ herror("doPOP3: socket");
|
|
|
|
+ else
|
|
|
|
+ perror("doPOP3: socket");
|
|
|
|
return(PS_SOCKET);
|
|
|
|
}
|
|
|
|
|
2010-07-09 03:17:37 -04:00
|
|
|
@@ -583,10 +587,10 @@ int socket;
|
|
|
|
int mboxfd;
|
|
|
|
int topipe;
|
|
|
|
{
|
|
|
|
- char buf [MSGBUFSIZE];
|
|
|
|
+ char buf [POPMSGBUFSIZE];
|
|
|
|
char *bufp;
|
|
|
|
char savec;
|
|
|
|
- char fromBuf[MSGBUFSIZE];
|
|
|
|
+ char fromBuf[POPMSGBUFSIZE];
|
|
|
|
int needFrom;
|
|
|
|
int lines,sizeticker;
|
|
|
|
time_t now;
|
|
|
|
@@ -607,9 +611,9 @@ int topipe;
|
|
|
|
|
|
|
|
/* read the message content from the server */
|
2004-08-07 14:18:20 -04:00
|
|
|
lines = 0;
|
2010-07-09 03:17:37 -04:00
|
|
|
- sizeticker = MSGBUFSIZE;
|
|
|
|
+ sizeticker = POPMSGBUFSIZE;
|
2004-08-07 14:18:20 -04:00
|
|
|
while (1) {
|
|
|
|
- if (SockGets(socket,buf,sizeof(buf)) < 0)
|
|
|
|
+ if (SockGets(socket,buf,sizeof(buf)-1) < 0)
|
|
|
|
return(PS_SOCKET);
|
|
|
|
bufp = buf;
|
|
|
|
if (*bufp == '.') {
|
2010-07-09 03:17:37 -04:00
|
|
|
@@ -653,7 +657,7 @@ int topipe;
|
|
|
|
if (sizeticker <= 0) {
|
|
|
|
if (outlevel > O_SILENT && outlevel < O_VERBOSE && mboxfd != 1)
|
|
|
|
fputc('.',stderr);
|
|
|
|
- sizeticker = MSGBUFSIZE;
|
|
|
|
+ sizeticker = POPMSGBUFSIZE;
|
|
|
|
}
|
|
|
|
lines++;
|
|
|
|
}
|