aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-09-23 05:56:18 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-09-23 05:56:18 +0000
commit897cad3662024798463bc418bddaac801228da76 (patch)
treebdb615c5380cef3df6a35679f28fc9044287d449 /driver.c
parent7776e2819833e302f654f7bfd34ff2c26b63460a (diff)
downloadfetchmail-897cad3662024798463bc418bddaac801228da76.tar.gz
fetchmail-897cad3662024798463bc418bddaac801228da76.tar.bz2
fetchmail-897cad3662024798463bc418bddaac801228da76.zip
Better protection against buffer overruns.
svn path=/trunk/; revision=106
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/driver.c b/driver.c
index a707d1da..b66a446f 100644
--- a/driver.c
+++ b/driver.c
@@ -66,7 +66,7 @@ struct method *proto;
{
int ok, len;
int mboxfd;
- char buf [POPBUFSIZE], host[HOSTLEN];
+ char buf [POPBUFSIZE+1], host[HOSTLEN+1];
int socket;
int first,number,count;
@@ -250,7 +250,7 @@ int socket;
const char *fmt;
va_dcl {
- char buf [POPBUFSIZE];
+ char buf [POPBUFSIZE+1];
va_list ap;
if (protocol->tagged)
@@ -288,7 +288,7 @@ const char *fmt;
va_dcl {
int ok;
- char buf [POPBUFSIZE];
+ char buf [POPBUFSIZE+1];
va_list ap;
if (protocol->tagged)
@@ -332,7 +332,7 @@ const char *host;
{
const char *from;
int state = 0;
- char mycopy[POPBUFSIZE];
+ char mycopy[POPBUFSIZE+1];
if (strncmp("From: ", buf, 6)
&& strncmp("To: ", buf, 4)
@@ -429,7 +429,7 @@ const char *host;
static char *nxtaddr(hdr)
char *hdr;
{
- static char *hp, *tp, address[POPBUFSIZE];
+ static char *hp, *tp, address[POPBUFSIZE+1];
static state;
if (hdr)
@@ -562,8 +562,8 @@ char *pophost;
int output;
int rewrite;
{
- char buf [MSGBUFSIZE];
- char fromBuf[MSGBUFSIZE];
+ char buf [MSGBUFSIZE+1];
+ char fromBuf[MSGBUFSIZE+1];
char *bufp, *headers, *unixfrom, *fromhdr, *tohdr, *cchdr, *bcchdr;
int n, oldlen;
int inheaders;