[srvx-commits] CVS: services/src helpserv.c,1.14.2.4,1.14.2.5
Brought to you by:
entrope
|
From: Adrian D. <sai...@us...> - 2002-09-30 01:19:32
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv23929
Modified Files:
Tag: rel-1_1-branch
helpserv.c
Log Message:
Fix a buffer overflow (on the stack... eek)
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.14.2.4
retrieving revision 1.14.2.5
diff -C2 -r1.14.2.4 -r1.14.2.5
*** helpserv.c 28 Sep 2002 23:32:05 -0000 1.14.2.4
--- helpserv.c 30 Sep 2002 01:19:29 -0000 1.14.2.5
***************
*** 2167,2171 ****
static HELPSERV_FUNC(cmd_register) {
! char *nick, *helpchan, *reason;
struct handle_info *handle;
--- 2167,2171 ----
static HELPSERV_FUNC(cmd_register) {
! char *nick, *helpchan, reason[MAXLEN];
struct handle_info *handle;
***************
*** 2202,2207 ****
helpserv_notice(user, HSMSG_REG_SUCCESS, handle->handle, nick);
! reason = alloca(strlen(user->nick) + strlen(nick) + strlen(hs->helpchan->name) + 43);
! sprintf(reason, "HelpServ %s (%s) registered to %s by %s.", nick, hs->helpchan->name, handle->handle, user->nick);
/* Not sent to helpers, since they can't register HelpServ */
global_message(MESSAGE_RECIPIENT_OPERS, reason);
--- 2202,2206 ----
helpserv_notice(user, HSMSG_REG_SUCCESS, handle->handle, nick);
! snprintf(reason, MAXLEN, "HelpServ %s (%s) registered to %s by %s.", nick, hs->helpchan->name, handle->handle, user->nick);
/* Not sent to helpers, since they can't register HelpServ */
global_message(MESSAGE_RECIPIENT_OPERS, reason);
|