cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Crash using WRITEDATA callback depending on CUSTOMREQUEST sent!

From: Arnaud Maye <amaye_at_hispeed-sr.ch>
Date: Fri, 16 Mar 2007 00:48:51 +0200

Gonzalo Diethelm wrote:
> On Wed, 2007-03-14 at 15:35 +0200, Arnaud Maye wrote:
>> size_t ShellUpdater::WriteData(void *buffer, size_t size, size_t nmemb,
>> void *userp)
>> {
>> char *data = (char *)buffer;
>>
>> strcat_s(gData, 600, data);
>> return size * nmemb;
>> }
>>
>
> I believe strcat_s() requires its first and third element to be
> null-terminated. There are no guarantees about that being the case for
> the buffer passed into your WRITEDATA function. Better switch that to
> a plain memcpy(), which, in addition, is more portable.
>
> Best regards,
>
> --
> Gonzalo Diethelm
> gonzalo.diethelm_at_diethelm.org
>
>
Well, it crash before to even reach the callback.

And gData is memset(,0,) during the init as well

I will need to debug whats wrong, it will be interesting, Lets debug
_perform to see whats going on

Regards

Arnaud
Received on 2007-03-15