added a null pointer check in huffman decompression code. it was possible to crash a masterserver by sending it a packet that had the compression flag (but not the connection-less flag) set because the huffman look up table is not initialized in the masterserver and thus resulted in a null-pointer-node. clients and servers (with initialized look up tables were not affected. it was also not possible to use this to inject code.

This commit is contained in:
m!nus 2010-10-29 01:28:11 +02:00 committed by oy
parent b343ef7f55
commit 523c15e0e7

View file

@ -228,6 +228,9 @@ int CHuffman::Decompress(const void *pInput, int InputSize, void *pOutput, int O
// {C} load symbol now if we didn't that earlier at location {A}
if(!pNode)
pNode = m_apDecodeLut[Bits&HUFFMAN_LUTMASK];
if(!pNode)
return -1;
// {D} check if we hit a symbol already
if(pNode->m_NumBits)