diff src/pop3/commands.c @ 2520:255cea3e2331 HEAD

fixed potential crash
author Timo Sirainen <tss@iki.fi>
date Tue, 31 Aug 2004 11:17:08 +0300
parents f8be7a5e273a
children 792b3209f705
line wrap: on
line diff
--- a/src/pop3/commands.c	Sun Aug 29 10:54:55 2004 +0300
+++ b/src/pop3/commands.c	Tue Aug 31 11:17:08 2004 +0300
@@ -296,10 +296,12 @@
 			}
 		}
 
-		if (o_stream_send(client->output, data, i) < 0)
-			break;
-		ctx->last = data[i-1];
-		i_stream_skip(ctx->stream, i);
+		if (i > 0) {
+			if (o_stream_send(client->output, data, i) < 0)
+				break;
+			ctx->last = data[i-1];
+			i_stream_skip(ctx->stream, i);
+		}
 
 		if (o_stream_get_buffer_used_size(client->output) > 0) {
 			/* continue later */