summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-03-08 00:10:39 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-03-08 00:10:39 +0000
commit951ab9d41f399b436e1221d894d1e7c43ea8267e (patch)
tree42350440996d41e34e25f3ea975277cfbe698f7d /src
parentdb0c0781899208264ad907ad8a5a73ea629fcce8 (diff)
downloadhercules-951ab9d41f399b436e1221d894d1e7c43ea8267e.tar.gz
hercules-951ab9d41f399b436e1221d894d1e7c43ea8267e.tar.bz2
hercules-951ab9d41f399b436e1221d894d1e7c43ea8267e.tar.xz
hercules-951ab9d41f399b436e1221d894d1e7c43ea8267e.zip
Added several mail id checks to prevent a map server crash (bugreport:2837).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13571 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 02d47ad0b..b8127054e 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11774,6 +11774,10 @@ void clif_Mail_read(struct map_session_data *sd, int mail_id)
void clif_parse_Mail_read(int fd, struct map_session_data *sd)
{
+ int mail_id = RFIFOL(fd,2);
+
+ if( mail_id <= 0 )
+ return;
if( mail_invalid_operation(sd) )
return;
@@ -11785,9 +11789,12 @@ void clif_parse_Mail_read(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_Mail_getattach(int fd, struct map_session_data *sd)
{
- int i, mail_id = RFIFOL(fd,2);
+ int mail_id = RFIFOL(fd,2);
+ int i;
bool fail = false;
+ if( mail_id <= 0 )
+ return;
if( mail_invalid_operation(sd) )
return;
@@ -11841,8 +11848,11 @@ void clif_parse_Mail_getattach(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_Mail_delete(int fd, struct map_session_data *sd)
{
- int i, mail_id = RFIFOL(fd,2);
+ int mail_id = RFIFOL(fd,2);
+ int i;
+ if( mail_id <= 0 )
+ return;
if( mail_invalid_operation(sd) )
return;
@@ -11866,8 +11876,11 @@ void clif_parse_Mail_delete(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_Mail_return(int fd, struct map_session_data *sd)
{
- int i, mail_id = RFIFOL(fd,2);
+ int mail_id = RFIFOL(fd,2);
+ int i;
+ if( mail_id <= 0 )
+ return;
if( mail_invalid_operation(sd) )
return;