mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-26 05:30:05 +00:00
Fixed a use-after-free and a memory leak.
This commit is contained in:
@@ -200,7 +200,7 @@ void CNSocket::step() {
|
||||
|
||||
if (activelyReading && readBufferIndex - readSize <= 0) {
|
||||
// decrypt readBuffer and copy to CNPacketData
|
||||
CNSocketEncryption::decryptData(readBuffer, (uint8_t*)(&EKey), readSize);
|
||||
CNSocketEncryption::decryptData((uint8_t*)&readBuffer, (uint8_t*)(&EKey), readSize);
|
||||
|
||||
void* tmpBuf = xmalloc(readSize-sizeof(int32_t));
|
||||
memcpy(tmpBuf, readBuffer+sizeof(uint32_t), readSize-sizeof(int32_t));
|
||||
|
||||
Reference in New Issue
Block a user