Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

  • #004166

  • 3 - Medium

  • Fixed

Issue Confirmations

  • Yes (0)No (0)
Photo

Mail - Empty recipient & 'space'

Posted by Hercules Bot on 02 April 2010 - 09:15 PM

Originally posted by Kazukin
http://www.eathena.w...er&showbug=4166

We can make a character named ' ' (4 spaces) and another one named ' ' (5 spaces) from the database to reproduce this bug. Once we have created both characters, send any mails whose recipient is empty or contains only spaces (it doesn't matter how many), all the mails will be sent to our ' ' (4 spaces) character, even when we introduce ' ' (5 spaces) which is the name of our second character, mails will still be sent to the 4 spaces one (they are sent to whatever character has less spaces).
I don't know how someone on my server made a character whose nick was ' ' (20 spaces), since you are supposed to get an error message, although maybe this was not always like that (my server is 3 years old), but the point is, sending an email leaving the recipient empty will cause it to be sent to a character whose nick is composed of spaces.

I didn't look further into it, but here is a quick fix:

Inside clif_parse_Mail_send() in clif.c
QUOTE
msg.id = 0; // id will be assigned by charserver
msg.send_id = sd->status.char_id;
msg.dest_id = 0; // will attempt to resolve name
safestrncpy(msg.send_name, sd->status.name, NAME_LENGTH);
safestrncpy(msg.dest_name, (char*)RFIFOP(fd,4), NAME_LENGTH);
safestrncpy(msg.title, (char*)RFIFOP(fd,28), MAIL_TITLE_LENGTH);

if (body_len)
safestrncpy(msg.body, (char*)RFIFOP(fd,69), body_len + 1);
else
memset(msg.body, 0x00, MAIL_BODY_LENGTH);

msg.timestamp = time(NULL);
- if( !intif_Mail_send(sd->status.account_id, &msg) )
+ if( !RFIFOB(fd,4) || !intif_Mail_send(sd->status.account_id, &msg) )
mail_deliveryfail(sd, &msg);

sd->cansendmail_tick = gettick() + 1000; // 1 Second flood Protection
}

Although it doesn't adress the main problem, which is, spaces are not being interpreted right somewhere.

This post has been edited by Kazukin: Apr 3 2010, 03:10 AM

Originally posted by Ind
Fixed in [rev=15168]