summaryrefslogtreecommitdiffstats
path: root/dcop/dcopserver.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-26 22:23:30 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-26 22:23:30 +0000
commit946bde4a62fa9c4c47315defb2e31cf54d821246 (patch)
tree4c8722f3db4e1cc5800519d00ccd30c60c50dd3d /dcop/dcopserver.cpp
parenta20928b6bfae18a41bb42b85e10f73fb63548ccc (diff)
downloadtdelibs-946bde4a62fa9c4c47315defb2e31cf54d821246.tar.gz
tdelibs-946bde4a62fa9c4c47315defb2e31cf54d821246.zip
Patch a few buffer overrun problems and odd crash potentials
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1217371 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'dcop/dcopserver.cpp')
-rw-r--r--dcop/dcopserver.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/dcop/dcopserver.cpp b/dcop/dcopserver.cpp
index ca810f390..ef37f0a32 100644
--- a/dcop/dcopserver.cpp
+++ b/dcop/dcopserver.cpp
@@ -131,6 +131,7 @@ static TQCString readQCString(TQDataStream &ds)
if ((bytesLeft < 0 ) || (len > (uint) bytesLeft))
{
qWarning("Corrupt data!\n");
+ printf("bytesLeft: %d, len: %d\n", bytesLeft, len);
return result;
}
result.TQByteArray::resize( (uint)len );
@@ -240,7 +241,7 @@ void DCOPIceWriteChar(register IceConn iceConn, unsigned long nbytes, char *ptr)
{
DCOPConnection* conn = the_server->findConn( iceConn );
#ifdef DCOP_DEBUG
-qWarning("DCOPServer: DCOPIceWriteChar() Writing %d bytes to %d [%s]", nbytes, fd, conn ? conn->appId.data() : "<unknown>");
+qWarning("DCOPServer: DCOPIceWriteChar() Writing %d bytes [%s]", nbytes, conn ? conn->appId.data() : "<unknown>");
#endif
if (conn)
@@ -272,7 +273,7 @@ static void DCOPIceWrite(IceConn iceConn, const TQByteArray &_data)
{
DCOPConnection* conn = the_server->findConn( iceConn );
#ifdef DCOP_DEBUG
-qWarning("DCOPServer: DCOPIceWrite() Writing %d bytes to %d [%s]", _data.size(), fd, conn ? conn->appId.data() : "<unknown>");
+qWarning("DCOPServer: DCOPIceWrite() Writing %d bytes [%s]", _data.size(), conn ? conn->appId.data() : "<unknown>");
#endif
if (conn)
{
@@ -1518,7 +1519,9 @@ bool DCOPServer::receive(const TQCString &/*app*/, const TQCString &obj,
TQCString slot = readQCString(args);
TQ_INT8 Volatile;
args >> Volatile;
- //qDebug("DCOPServer: connectSignal(sender = %s senderObj = %s signal = %s recvObj = %s slot = %s)", sender.data(), senderObj.data(), signal.data(), receiverObj.data(), slot.data());
+#ifdef DCOP_DEBUG
+ qDebug("DCOPServer: connectSignal(sender = %s senderObj = %s signal = %s recvObj = %s slot = %s)", sender.data(), senderObj.data(), signal.data(), receiverObj.data(), slot.data());
+#endif
bool b = dcopSignals->connectSignal(sender, senderObj, signal, conn, receiverObj, slot, (Volatile != 0));
replyType = "bool";
TQDataStream reply( replyData, IO_WriteOnly );
@@ -1534,7 +1537,9 @@ bool DCOPServer::receive(const TQCString &/*app*/, const TQCString &obj,
TQCString signal = readQCString(args);
TQCString receiverObj = readQCString(args);
TQCString slot = readQCString(args);
- //qDebug("DCOPServer: disconnectSignal(sender = %s senderObj = %s signal = %s recvObj = %s slot = %s)", sender.data(), senderObj.data(), signal.data(), receiverObj.data(), slot.data());
+#ifdef DCOP_DEBUG
+ qDebug("DCOPServer: disconnectSignal(sender = %s senderObj = %s signal = %s recvObj = %s slot = %s)", sender.data(), senderObj.data(), signal.data(), receiverObj.data(), slot.data());
+#endif
bool b = dcopSignals->disconnectSignal(sender, senderObj, signal, conn, receiverObj, slot);
replyType = "bool";
TQDataStream reply( replyData, IO_WriteOnly );