mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix out of bounds read in checksum stuff
This commit is contained in:
parent
b955d68efd
commit
e026bce50f
|
@ -4131,7 +4131,10 @@ int CClient::HandleChecksum(int Conn, CUuid Uuid, CUnpacker *pUnpacker)
|
|||
sha256_update(&Sha256Ctxt, &Uuid, sizeof(Uuid));
|
||||
sha256_update(&Sha256Ctxt, aStartBytes, sizeof(aStartBytes));
|
||||
sha256_update(&Sha256Ctxt, aEndBytes, sizeof(aEndBytes));
|
||||
sha256_update(&Sha256Ctxt, m_Checksum.m_aBytes + Start, ChecksumBytesEnd - Start);
|
||||
if(Start < (int)sizeof(m_Checksum.m_aBytes))
|
||||
{
|
||||
sha256_update(&Sha256Ctxt, m_Checksum.m_aBytes + Start, ChecksumBytesEnd - Start);
|
||||
}
|
||||
if(End > (int)sizeof(m_Checksum.m_aBytes))
|
||||
{
|
||||
unsigned char aBuf[2048];
|
||||
|
|
Loading…
Reference in a new issue