[r2373-gd8d205]Potential NULL crash in A_CStaffCheck

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

[r2373-gd8d205]Potential NULL crash in A_CStaffCheck

Post by Edward-san »

The changes in revision 2373 introduced potential NULL pointer crashes in some files in g_hexen . r2415 should have supposed to fix it in all the files, but it seems the fix is missing for the P_LineAttack changes in a_clericstaff.cpp :

line 70:

Code: Select all

		if (linetarget)
		{
			P_LineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, NAME_Melee, PClass::FindClass ("CStaffPuff"), false, &linetarget);
			pmo->angle = R_PointToAngle2 (pmo->x, pmo->y, 
				linetarget->x, linetarget->y); // <- argh! potential crash here!
			if (((linetarget->player && (!linetarget->IsTeammate (pmo) || level.teamdamage != 0))|| linetarget->flags3&MF3_ISMONSTER)
				&& (!(linetarget->flags2&(MF2_DORMANT+MF2_INVULNERABLE))))
and line 95:

Code: Select all

			P_LineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, NAME_Melee, PClass::FindClass ("CStaffPuff"), false, &linetarget);
			pmo->angle = R_PointToAngle2 (pmo->x, pmo->y, 
				linetarget->x, linetarget->y); // <- argh! potential crash here!
			if ((linetarget->player && (!linetarget->IsTeammate (pmo) || level.teamdamage != 0)) || linetarget->flags3&MF3_ISMONSTER)
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: [r2373-gd8d205]Potential NULL crash in A_CStaffCheck

Post by randi »

Post Reply

Return to “Closed Bugs [GZDoom]”