Hi all,

every now and then there were following errors in my network log:

--
23:34:04: [WRN] Unknown TCP version 0 from socket.
23:34:04: [WRN] TCP message from invalid UIN (134754065, expect 1869770605):
0000: FF 08 00 2B 00 EA D8 B1 06 00 00 01 15 00 00 3B ...+...........;
0010: 76 8B 12 D4 56 12 A7 D4 56 12 A7 04 01 15 00 00 v...V...V.......
0020: FA DD 5E 37 50 00 00 00 03 00 00 00 00 00 00 00 ..^7P...........
23:34:04: [TCP] Closing connection to 1869770605.
--


Sometimes I couldn't receive file transfers and this error was found
from the log. The UINs shown there were totally random numbers, nothing
to do with the real UINs.

The bug was with uninitialised variable INetSocket::m_nOwner. Owner uin
0 is given to the object created in src/icqd-threads.cpp:676 but it
is not set to the variable m_nOwner in the constructor nor anytime.
When calling Owner() of the object it will give random results and thus
skips handshake processing in src/icqd-threads.cpp:724.

Attached simple patch file fixes this bug. The patch file has been made
against the cvs. Again, you can fetch it from here:
http://tumppi.net/licq/licq-socket-fix.diff

Regards,
--
# Tuomas Jaakola
Index: src/socket.cpp
===================================================================
RCS file: /cvsroot/licq/licq/src/socket.cpp,v
retrieving revision 1.35
diff -u -1 -b -p -r1.35 socket.cpp
--- src/socket.cpp      2 Jul 2003 04:41:01 -0000       1.35
+++ src/socket.cpp      9 Jan 2004 21:38:34 -0000
@@ -233,2 +233,3 @@ INetSocket::INetSocket(unsigned long _nO
 {
+  m_nOwner = _nOwner;
   m_nDescriptor = -1;
@@ -240,3 +241,2 @@ INetSocket::INetSocket(unsigned long _nO
     m_nOwnerPPID = LICQ_PPID;
-    m_nOwner = _nOwner;
   }
@@ -268,2 +268,4 @@ INetSocket::INetSocket(const char *_szOw
     m_nOwner = strtoul(_szOwnerId, (char **)NULL, 10);
+  else
+    m_nOwner = 0;
   m_nVersion = 0;

Reply via email to