Issue information

Issue ID
#4947
Status
Fixed
Severity
Critical
Started
Hercules Elf Bot
Jun 3, 2011 15:39
Last Post
Hercules Elf Bot
Jun 3, 2011 15:39
Confirmation
N/A

Hercules Elf Bot - Jun 3, 2011 15:39

Originally posted by [b]daniel_gp[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=4947

Well, since the last update to prevent the user to add himself as friend, there's a bug that crashes the map-server.
I've found it on GDB, after my server crashes twice.

I fixed it just checking if f_sd is null before comparing with sd, but i dunno if it's the right way, so...

clif.c

Before:
CODE
    if( sd->bl.id == f_sd->bl.id )
    {// adding oneself as friend
        return;
    }

    // Friend doesn't exist (no player with this name)
    if (f_sd == NULL) {
        clif_displaymessage(fd, msg_txt(3));
        return;
    }


After:
CODE
    // Friend doesn't exist (no player with this name)
    if (f_sd == NULL) {
        clif_displaymessage(fd, msg_txt(3));
        return;
    }

    if( sd->bl.id == f_sd->bl.id )
    {// adding oneself as friend
        return;
    }


This post has been edited by daniel_gp: Jun 3 2011, 08:41 AM