From: Alexander Barton Date: Thu, 17 May 2007 15:16:47 +0000 (+0000) Subject: Zip_Flush(): close the connection in all error cases. X-Git-Tag: rel-0-11-0-pre2~51 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=commitdiff_plain;h=5930a29197d9b45ce4e09d7c02aa7da3e2400272;ds=sidebyside Zip_Flush(): close the connection in all error cases. --- diff --git a/src/ngircd/conn-zip.c b/src/ngircd/conn-zip.c index 5ac83234..f162d2bc 100644 --- a/src/ngircd/conn-zip.c +++ b/src/ngircd/conn-zip.c @@ -22,7 +22,7 @@ /* enable more zlib related debug messages: */ /* #define DEBUG_ZLIB */ -static char UNUSED id[] = "$Id: conn-zip.c,v 1.14 2007/05/17 14:46:14 fw Exp $"; +static char UNUSED id[] = "$Id: conn-zip.c,v 1.15 2007/05/17 15:16:47 alex Exp $"; #include "imp.h" #include @@ -159,8 +159,11 @@ Zip_Flush( CONN_ID Idx ) Log(LOG_DEBUG, "zipbuf_used: %d", zipbuf_used); #endif if (!array_catb(&My_Connections[Idx].wbuf, - (char *)zipbuf, (size_t) zipbuf_used)) + (char *)zipbuf, (size_t) zipbuf_used)) { + Log (LOG_ALERT, "Compression error: can't copy data!?"); + Conn_Close(Idx, "Compression error!", NULL, false); return false; + } My_Connections[Idx].bytes_out += zipbuf_used; My_Connections[Idx].zip.bytes_out += array_bytes(&My_Connections[Idx].zip.wbuf);