[r2373-gd8d205]Potential NULL crash in A_CStaffCheck
Posted: Mon Feb 16, 2015 5:47 am
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:
and line 95:
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))))
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)