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
This commit is contained in:
Kevin Easton
2013-11-13 09:57:15 +00:00
parent 582d720ea4
commit 3b99834e00

View File

@@ -147,8 +147,8 @@ void BX_close_server (int cs_index, char *message)
if (x_debug & DEBUG_OUTBOUND) if (x_debug & DEBUG_OUTBOUND)
yell("Closing server %d because [%s]", yell("Closing server %d because [%s]",
cs_index, message ? message : empty_string); cs_index, message ? message : empty_string);
snprintf(buffer, sizeof buffer, "QUIT :%s", message); snprintf(buffer, MAX_PROTOCOL_SIZE + 1, "QUIT :%s", message);
strlcat(buffer, "\r\n", IRCD_BUFFER_SIZE + 1); strlcat(buffer, "\r\n", sizeof buffer);
#ifdef HAVE_SSL #ifdef HAVE_SSL
if (get_server_ssl(cs_index)) if (get_server_ssl(cs_index))
{ {