mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-02 09:55:55 +00:00
Merge pull request #10864 from Chocobo1/qapp
Tighten up qtsingleapplication
This commit is contained in:
commit
11000412d8
@ -101,6 +101,7 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
server = new QLocalServer(this);
|
server = new QLocalServer(this);
|
||||||
|
server->setSocketOptions(QLocalServer::UserAccessOption);
|
||||||
QString lockName = QDir(QDir::tempPath()).absolutePath()
|
QString lockName = QDir(QDir::tempPath()).absolutePath()
|
||||||
+ QLatin1Char('/') + socketName
|
+ QLatin1Char('/') + socketName
|
||||||
+ QLatin1String("-lockfile");
|
+ QLatin1String("-lockfile");
|
||||||
@ -191,6 +192,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