From 1765cd3f72d20ce81c8b21115242028775a0497e Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 20 Mar 2006 15:38:00 +0000 Subject: - @stfu now allows negative intervals to be specified, they increase manner instead. - Added overflow fix to the login-server when sending GM accounts to char. - Increased buffer size abit in check_ip (login.c) to see if it prevents stack corruption. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5683 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/login/login.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/login/login.c') diff --git a/src/login/login.c b/src/login/login.c index 538df26ab..a1a4243fe 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -413,7 +413,7 @@ int check_ipmask(unsigned int ip, const unsigned char *str) { int check_ip(unsigned int ip) { int i; unsigned char *p = (unsigned char *)&ip; - char buf[16]; + char buf[20]; char * access_ip; enum { ACF_DEF, ACF_ALLOW, ACF_DENY } flag = ACF_DEF; @@ -462,7 +462,7 @@ int check_ip(unsigned int ip) { int check_ladminip(unsigned int ip) { int i; unsigned char *p = (unsigned char *)&ip; - char buf[16]; + char buf[20]; char * access_ip; if (access_ladmin_allownum == 0) @@ -1034,6 +1034,10 @@ void send_GM_accounts(void) { WBUFL(buf,len) = gm_account_db[i].account_id; WBUFB(buf,len+4) = (unsigned char)gm_account_db[i].level; len += 5; + if (len >= 32000) { + ShowWarning("send_GM_accounts: Too many accounts! Only %d out of %d were sent.\n", i, GM_num); + break; + } } WBUFW(buf,2) = len; charif_sendallwos(-1, buf, len); -- cgit v1.2.3-60-g2f50