bug-commoncpp
[Top][All Lists]
Advanced

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

bug in TCPStream::overflow


From: Keith Thornton
Subject: bug in TCPStream::overflow
Date: Fri, 19 Dec 2003 07:17:45 +0100

Commoncpp2-1.0.13 file socket.cpp line 1438
I think that the line memmove(pbuf, pptr() + rlen, req);
should read memmove(pbuf, pbuf + rlen, req);

TCPStream::overflow() is called because the buffer is full and data needs
to be written to the device. I.e. pptr() == epptr.
therefore,  reading from pptr() + rlen reads from past the end of the
buffer causing a segmentation violation. We really want to move the data
which could not be written to the device (pbase + rlen) to the start of the
buffer.
Best wishes
Keith Thornton






reply via email to

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