aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS12
-rw-r--r--driver.c4
-rw-r--r--socket.c3
3 files changed, 16 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 02756aa5..379bd912 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,18 @@
Release Notes:
------------------------------------------------------------------------------
+fetchmail-3.7 ()
+
+features --
+
+* Treat unexpected EOF as a protocol error.
+
+bugs --
+
+* Fix password-shrouding logic so it doesn't crap out on a zero-length
+ password.
+
+------------------------------------------------------------------------------
fetchmail-3.6 (Mon Feb 17 00:19:55 EST 1997)
features --
diff --git a/driver.c b/driver.c
index fb47457b..98669ecf 100644
--- a/driver.c
+++ b/driver.c
@@ -1512,7 +1512,7 @@ va_dcl
{
char *cp;
- if (shroud && (cp = strstr(buf, shroud)))
+ if (shroud && shroud[0] && (cp = strstr(buf, shroud)))
{
char *sp;
@@ -1582,7 +1582,7 @@ va_dcl
{
char *cp;
- if (shroud && (cp = strstr(buf, shroud)))
+ if (shroud && shroud[0] && (cp = strstr(buf, shroud)))
{
char *sp;
diff --git a/socket.c b/socket.c
index 6b2076e7..e5b9ba5c 100644
--- a/socket.c
+++ b/socket.c
@@ -118,7 +118,8 @@ char *SockGets(char *buf, int len, FILE *sockfp)
if (--len < 1)
return NULL;
do {
- if ((n = recv(fileno(sockfp), bp, len, MSG_PEEK)) == -1)
+ /* return value of 0 is EOF, < 0 is error */
+ if ((n = recv(fileno(sockfp), bp, len, MSG_PEEK)) <= 0)
return NULL;
if ((p = memchr(bp, '\n', n)) != NULL)
{