From: Vlad S. <vl...@cr...> - 2008-05-27 21:45:39
|
Nice catch Daniel Stasinski wrote: > On Tue, May 27, 2008 at 10:30 AM, Vlad Seryakov <vl...@cr...> wrote: >> Just tested it, works fine regardless is it first time or not > > I spent an hour going through it and tracked down the problem. > > rc = mc_conn_read(conn, BUFSIZE, 1, &line); > > On the first read, the line arg is set to point to an offset within > conn->ds.dstring. The problem is that mc_conn_read() there are calls > to Ns_DStringSetLength() which can (and does) relocate > conn->ds.dstring, therefor leaving &line pointing to a deallocated > memory block. The only time ds.dstring is in a static location is > when it's 200 bytes or less. > > I just happened come across a perhaps a platform specific set of data > that could duplicate the problem over and over. > > Will patch and update cvs. > > Daniel > |