1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Drop suspiciously large data

This is to avoid exhausting system memory.
This commit is contained in:
Chocobo1 2019-06-27 20:29:02 +08:00
parent cd654d61fd
commit 6119cb370f
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -191,6 +191,12 @@ void QtLocalPeer::receiveConnection()
QByteArray uMsg;
quint32 remaining;
ds >> remaining;
if (remaining > 65535) {
// drop suspiciously large data
delete socket;
return;
}
uMsg.resize(remaining);
int got = 0;
char* uMsgBuf = uMsg.data();