[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [simon] sscd/src: Make sure we have enough data to read a command id
From:       Peter Grasch <me () bedahr ! org>
Date:       2013-06-17 19:38:52
Message-ID: 20130617193852.A86B0A605A () git ! kde ! org
[Download RAW message or body]

Git commit 9f48c2f288af2e87a3a37e3e2b1e21b1b1141c99 by Peter Grasch.
Committed on 17/06/2013 at 21:37.
Pushed by grasch into branch 'master'.

Make sure we have enough data to read a command id

M  +1    -1    sscd/src/clientsocket.cpp

http://commits.kde.org/simon/9f48c2f288af2e87a3a37e3e2b1e21b1b1141c99

diff --git a/sscd/src/clientsocket.cpp b/sscd/src/clientsocket.cpp
index 79af725..c7b877b 100644
--- a/sscd/src/clientsocket.cpp
+++ b/sscd/src/clientsocket.cpp
@@ -299,7 +299,7 @@ void ClientSocket::processRequest()
   QDataStream stream(&msg, QIODevice::ReadOnly);
   qint32 type;
 
-  while (!stream.atEnd()) {
+  while (!stream.atEnd() && ((unsigned) stream.device()->bytesAvailable() \
>= sizeof(qint32))) {  SSC::Request request;
     stream >> type;
     request = (SSC::Request) type;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic