[r2373-gd8d205]Potential NULL crash in A_CStaffCheck

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [r2373-gd8d205]Potential NULL crash in A_CStaffCheck

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

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

[r2373-gd8d205]Potential NULL crash in A_CStaffCheck

by Edward-san » 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:

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)

Top