Skip to content

Remove the strunzone call from UnsetMovetypeFollow because it can cause a crash

thatretrodev requested to merge (removed):master into master

When using the Mine Layer, the game can crash because it tries to free a constant string.

A simple way to reproduce it (and how I discovered it) is to create a LAN match on Solarium with 9 bots on Godlike difficulty that can only use Mine Layers.

This crash is not a problem on the latest stable version (0.8.2) because it was made before b0e309667b409faea3589943b52c3327e95194b1, which introduced the crash.

Stacktrace:

Host_Error: PRVM_FreeString: attempt to free a constant string
QuakeC crash report for server:
s94073: :1985: ADDRESS    GLOBAL48370, .dphitcontentsmask (=.dphitcontentsmask), GLOBAL48352
s94074: :1985: BITOR      DPCONTENTS_SOLID (=1), DPCONTENTS_BODY (=32), GLOBAL48353
s94075: :1985: BITOR      GLOBAL48353, DPCONTENTS_CORPSE (=64), GLOBAL48353
s94076: :1985: STOREP_F   GLOBAL48353, GLOBAL48352
s94077: :1986: FIELD_S    GLOBAL48370, .aiment_classname (=.aiment_classname), GLOBAL48352
s94078: :1986: IFNOT      GLOBAL48352, statement 94081
s94079: :1987: FIELD_S    GLOBAL48370, .classname (=.classname), GLOBAL4
s94080: :1987: CALL1      strunzone (=strunzone())
            :1987 : UnsetMovetypeFollow : statement 12
        arm5:167 : W_MineLayer_Think : statement 9
./lib/self.qh:67 : think_self : statement 3

Removing the strunzone call from UnsetMovetypeFollow in qcsrc/common/util.qc fixes the problem.

Edited by Dr. Jaska

Merge request reports