mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-08-26 05:32:05 +00:00
Drop suspiciously large data
This is to avoid exhausting system memory.
This commit is contained in:
parent
cd654d61fd
commit
6119cb370f
@ -191,6 +191,12 @@ void QtLocalPeer::receiveConnection()
|
|||||||
QByteArray uMsg;
|
QByteArray uMsg;
|
||||||
quint32 remaining;
|
quint32 remaining;
|
||||||
ds >> remaining;
|
ds >> remaining;
|
||||||
|
if (remaining > 65535) {
|
||||||
|
// drop suspiciously large data
|
||||||
|
delete socket;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uMsg.resize(remaining);
|
uMsg.resize(remaining);
|
||||||
int got = 0;
|
int got = 0;
|
||||||
char* uMsgBuf = uMsg.data();
|
char* uMsgBuf = uMsg.data();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user