Page 1 of 1

[r2373-gd8d205]Potential NULL crash in A_CStaffCheck

Posted: Mon Feb 16, 2015 5:47 am
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)

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

Posted: Fri Feb 20, 2015 8:17 pm
by randi