about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2005-08-27 23:42:23 +0000
committerFlorian Westphal <fw@strlen.de>2005-08-27 23:42:23 +0000
commita2cdc08c396d6ba3906ffb9478ce2ac52257ae93 (patch)
tree3634596f0304a53d850f1ac59e01ee96e548aaac /src
parente728bd2e1a5bcf69596b8c2a305cd6decbeaf42a (diff)
downloadngircd-a2cdc08c396d6ba3906ffb9478ce2ac52257ae93.tar.gz
ngircd-a2cdc08c396d6ba3906ffb9478ce2ac52257ae93.zip
fix handling of empty requests
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/conn.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index c1bc4c23..8f343ea4 100644
--- a/src/ngircd/conn.c
+++ b/src/ngircd/conn.c
@@ -17,7 +17,7 @@
 #include "portab.h"
 #include "io.h"
 
-static char UNUSED id[] = "$Id: conn.c,v 1.171 2005/08/27 23:33:11 alex Exp $";
+static char UNUSED id[] = "$Id: conn.c,v 1.172 2005/08/27 23:42:23 fw Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -1214,6 +1214,10 @@ Handle_Buffer( CONN_ID Idx )
 			return false;
 		}
 
+		if (len < 3) { /* request was empty (only '\r\n') */
+			array_trunc(&My_Connections[Idx].rbuf);
+			break;
+		}
 #ifdef ZLIB
 		/* remember if stream is already compressed */
 		old_z = My_Connections[Idx].options & CONN_ZIP;