From 3b99834e00025d586a6894a25fa94ea49bf487ba Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Wed, 13 Nov 2013 09:57:15 +0000 Subject: [PATCH] Partially revert r456. An snprintf() call that creates IRC protocol messages must use (MAX_PROTOCOL_SIZE + 1) as 'n' rather than the buffer size. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@461 13b04d17-f746-0410-82c6-800466cd88b0 --- source/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/server.c b/source/server.c index 0cf2b19..d0431f7 100644 --- a/source/server.c +++ b/source/server.c @@ -147,8 +147,8 @@ void BX_close_server (int cs_index, char *message) if (x_debug & DEBUG_OUTBOUND) yell("Closing server %d because [%s]", cs_index, message ? message : empty_string); - snprintf(buffer, sizeof buffer, "QUIT :%s", message); - strlcat(buffer, "\r\n", IRCD_BUFFER_SIZE + 1); + snprintf(buffer, MAX_PROTOCOL_SIZE + 1, "QUIT :%s", message); + strlcat(buffer, "\r\n", sizeof buffer); #ifdef HAVE_SSL if (get_server_ssl(cs_index)) {