[htdig3-dev] Core with testnet


loic@ceic.com
Wed, 6 Oct 1999 15:10:37 +0200 (MEST)


Gabriele Bartolini writes:
>
> Ciao talponi,
>
> trying the testnet program by specifying more than 1 time, I get a core
> dumping at the end of it. It's while it does the HtHTTP destructor.
>
> I don't know why, and trying with libtool gdb, I found that's due to a
> malloc call. I think the problem is outside the class, and it's probably
> belonging to the String class.
>
> I hope I am wrong ...
>

 I'm purifying testnet to track the source of the core dump. First remark:

 There is an uninitialized memory read at the following location:

            HtHTTP::ReadChunkedBody() [HtHTTP.cc:933]
                     _connection.read_line(ChunkHeader);
               
                     // Append the chunk-data to the contents of the response
            => _response._contents << buffer;
                                 
                     length+=chunk_size;
               
 you should save the return of read and use
_response._contents.append(buffer, read_count). Buffer is not null
terminated. This is a source of big problems.

-- 
		Loic Dachary

ECILA 100 av. du Gal Leclerc 93500 Pantin - France Tel: 33 1 56 96 09 80, Fax: 33 1 56 96 09 61 e-mail: Loic@Dachary.org URL: http://www.senga.org/

------------------------------------ To unsubscribe from the htdig3-dev mailing list, send a message to htdig3-dev@htdig.org containing the single word "unsubscribe" in the SUBJECT of the message.



This archive was generated by hypermail 2.0b3 on Wed Oct 06 1999 - 06:06:31 PDT