From a37e578151ccf4c34932480df9b52ebf53862bfc Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 4 Dec 2005 03:37:55 +0100 Subject: Fixes potential DoS attack. --- bitlbee.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bitlbee.c') diff --git a/bitlbee.c b/bitlbee.c index ef64a753..2eecf982 100644 --- a/bitlbee.c +++ b/bitlbee.c @@ -164,7 +164,15 @@ gboolean bitlbee_io_current_client_read( GIOChannel *source, GIOCondition condit irc_free( irc ); return FALSE; } - + + /* Very naughty, go read the RFCs! >:) */ + if( strlen( irc->readbuffer ) > 1024 ) + { + log_message( LOGLVL_ERROR, "Maximum line length exceeded." ); + irc_free( irc ); + return FALSE; + } + return TRUE; } -- cgit v1.2.3