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: [EMAIL PROTECTED] URL: http://www.senga.org/
------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED] containing the single word "unsubscribe" in
the SUBJECT of the message.