mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
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:
parent
b343ef7f55
commit
523c15e0e7
|
@ -229,6 +229,9 @@ int CHuffman::Decompress(const void *pInput, int InputSize, void *pOutput, int O
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
pNode = m_apDecodeLut[Bits&HUFFMAN_LUTMASK];
|
pNode = m_apDecodeLut[Bits&HUFFMAN_LUTMASK];
|
||||||
|
|
||||||
|
if(!pNode)
|
||||||
|
return -1;
|
||||||
|
|
||||||
// {D} check if we hit a symbol already
|
// {D} check if we hit a symbol already
|
||||||
if(pNode->m_NumBits)
|
if(pNode->m_NumBits)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue