Issue information

Issue ID
#8171
Status
Fixed
Severity
None
Started
memoryss
May 2, 2014 7:01
Last Post
Ind
Sep 21, 2014 18:23
Confirmation
N/A

memoryss - May 2, 2014 7:01

char-server crashes when a player login while map-server is executing OnInterIfInit/OnInterIfInitOnce events.

To reproduce the issue, run the following script:
- script test -1,{
OnInterIfInit:
freeloop(1);
for( ; ; ) ;
}
login a character while map-server is executing the event.

fix:
char.c
ARR_FIND( 0, ARRAYLENGTH(server), server_id, server[server_id].fd > 0 && server[server_id].map[0] );
change to
ARR_FIND( 0, ARRAYLENGTH(server), server_id, server[server_id].fd > 0 && server[server_id].map );

This post has been edited by memoryss on May 2, 2014 8:08

Tepoo - May 2, 2014 9:21

why should someone write such a script for his server?

memoryss - May 2, 2014 15:04

the script is only for reproducing this issue

Haru - May 2, 2014 20:03

server[serever_id].maps can also be used.

There should be a few more cases where it needs to be fixed, too

Ind - Sep 21, 2014 18:23

Fixed in [url="https://github.com/HerculesWS/Hercules/commit/e2ab0ffb71a44ff2a5b675e988e78137a00e183f"]https://github.com/HerculesWS/Hercules/commit/e2ab0ffb71a44ff2a5b675e988e78137a00e183f[/url]