diff options
| author | Eric S. Raymond <esr@thyrsus.com> | 1996-09-23 05:56:18 +0000 | 
|---|---|---|
| committer | Eric S. Raymond <esr@thyrsus.com> | 1996-09-23 05:56:18 +0000 | 
| commit | 897cad3662024798463bc418bddaac801228da76 (patch) | |
| tree | bdb615c5380cef3df6a35679f28fc9044287d449 /driver.c | |
| parent | 7776e2819833e302f654f7bfd34ff2c26b63460a (diff) | |
| download | fetchmail-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.c | 14 | 
1 files changed, 7 insertions, 7 deletions
| @@ -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; | 
