summaryrefslogtreecommitdiff
path: root/smtp.c
diff options
context:
space:
mode:
Diffstat (limited to 'smtp.c')
-rw-r--r--smtp.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/smtp.c b/smtp.c
index 033edaf..1ad0832 100644
--- a/smtp.c
+++ b/smtp.c
@@ -135,17 +135,16 @@ static const char * message_cb (void **buf, int *len, void *arg)
int octets;
if (len == NULL)
+ {
+ /* only allow rewinding in the beginning of a message otherwise
+ * it will break the pipes */
assert(*buf == NULL);
+ return;
+ }
if (*buf == NULL)
*buf = malloc (BUFSIZ);
- if (len == NULL)
- {
- message_rewind(message);
- return NULL;
- }
-
*len = message_read(message, *buf, BUFSIZ);
return *buf;