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

Issue Confirmations

  • Yes (0)No (0)
Photo

getusers(0) crashes without attached player

Posted by Hercules Bot on 24 November 2010 - 09:52 AM

Originally posted by Ai4rei
http://www.eathena.w...er&showbug=4565

Currently there is an issue in script command getusers, causing the map-server to crash, when the command is called with parameter 0 and without attached player.

CODE
BUILDIN_FUNC(getusers)
{
    int flag=script_getnum(st,2);
    struct block_list *bl=map_id2bl((flag&0x08)?st->oid:st->rid);
    int val=0;
    switch(flag&0x07){
    case 0: val=map[bl->m].users; break;  // bl==NULL
    case 1: val=map_getusers(); break;
    }
    script_pushint(st,val);
    return 0;
}


map_id2bl return value is not checked, whether it is NULL or not, and causes access violation on bl->m then.

CODE
prontera,150,150,0    script    TestNPC    123,{
    detachrid;
    getusers 0;
    end;
}