aboutsummaryrefslogtreecommitdiffstats
path: root/transact.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2004-12-22 09:43:39 +0000
committerMatthias Andree <matthias.andree@gmx.de>2004-12-22 09:43:39 +0000
commitce0baa186214cd0d22801a747fa3e204c82bea0c (patch)
tree6f4662a6ada86ecee30192f4b651667ef2acde09 /transact.c
parent58b3d0fd8c89e70b3f44dc86978a5ea99ece597f (diff)
downloadfetchmail-ce0baa186214cd0d22801a747fa3e204c82bea0c.tar.gz
fetchmail-ce0baa186214cd0d22801a747fa3e204c82bea0c.tar.bz2
fetchmail-ce0baa186214cd0d22801a747fa3e204c82bea0c.zip
Check for SockWrite() return and bail out on short writes.
svn path=/trunk/; revision=4016
Diffstat (limited to 'transact.c')
-rw-r--r--transact.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/transact.c b/transact.c
index 247d3e65..f9328df2 100644
--- a/transact.c
+++ b/transact.c
@@ -1503,7 +1503,10 @@ va_dcl
va_end(ap);
snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "\r\n");
- SockWrite(sock, buf, strlen(buf));
+ if (SockWrite(sock, buf, strlen(buf)) < strlen(buf)) {
+ /* short write, bail out */
+ return PS_SOCKET;
+ }
if (outlevel >= O_MONITOR)
{