bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with copying constructor and unbuffered TCPStream


From: Ian Campbell
Subject: Problem with copying constructor and unbuffered TCPStream
Date: Mon, 4 Feb 2002 16:36:50 -0000

Hello David et al,
    I discovered a problem with the using the copy constructor and TCPStream
with a buffer size of < 2. This is because the copy constructor does not
make gbuf and pbuf NULL when copying which in turn causes the destructor to
segmentation fault. Here is a patch for this:

--- socket.cpp~ Mon Oct 29 12:32:00 2001
+++ socket.cpp Sun Feb  3 09:43:30 2002
@@ -959,6 +959,7 @@
  if(size < 2)
  {
   bufsize = 1;
+  gbuf = pbuf = NULL;
   return;
  }

Cheers,

Ian Campbell
Band-X




reply via email to

[Prev in Thread] Current Thread [Next in Thread]