Open hzqst opened 8 years ago
Where you have taken source code?
Linux engine binary (engine.so) has all function's name and global vars' name inside, so that you can generate c style code with debug tools even without pdb or any debug symbol file. However GoldSRC's sound engine is very similar as Quake2's so you can even find these from https://github.com/idsoftware/quake2/blob/master/client/snd_dma.c
VOX isn't exists in quake 2 engine
@mikela-valve Can confirm this still crashes clients. Should be easy to fix, pass in the channel that gets set up right before the function call?
For example you type
speak "*doors/doormove1.wav"
in Half-Life's console, the game will crash and quit as soon as you commit this command.The reason why game crashed is that
VOX_LoadSound
passed an invalid channel (NULL) as an argument toS_LoadSound
.Meanwhile
S_LoadSound
threated sfx as a stream sound and it went the stream way:An invalid channel (NULL) went S_LoadStreamSound
You know, line
i = ch - channels;
would give a large and unpredictable value toint i
, and there would be an index out of bounds error inwavstreams[i].hFile
, This would cause a memory access error and crash the game.This bug could be used in some evil server owners trying to crash players' game.