mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Drop suspiciously large data
This is to avoid exhausting system memory.
This commit is contained in:
parent
a8bfec081e
commit
31a6ad1eb6
1 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue