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

  • #008705

  • 0 - None Assigned

  • New

Issue Confirmations

  • Yes (0)No (0)
Photo

UNT_FIREWALL + UNT_KAEN can cause crash when SA_LANDPROTECTOR is cast during race condition

Posted by Ancyker on 28 May 2015 - 04:42 PM

skill.c
	switch (sg->unit_id) {
		case UNT_FIREWALL:
		case UNT_KAEN: {
			int count=0;
			const int x = bl->x, y = bl->y;

			if( sg->skill_id == GN_WALLOFTHORN && !map_flag_vs(bl->m) )
				break;

			//Take into account these hit more times than the timer interval can handle.
			do
				skill->attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*sg->interval,0);
			while(--src->val2 && x == bl->x && y == bl->y
			   && ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status->isdead(bl));


			if (src->val2<=0)
				skill->delunit(src);
		}
		break;
If SA_LANDPROTECTOR is cast over a UNT_FIREWALL or UNT_KAEN unit during the while statements execution, the code will pull garbage data and crash.

The above is an assumption, as I did not test further. This was discovered by spamming firewall (and firepillar) on a player that had a Detale card.