cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_perform results in segmentation fault

From: Linus Nielsen Feltzing <linus_at_haxx.se>
Date: Fri, 23 Apr 2010 16:28:13 +0200

On 2010-04-23 16:14, Marcus Mundt wrote:
> strcat(data, "server_ip=192.168.101.10&session_name=");

First of all, you should read up on the printf() and sprintf()
functions, it will save you a lot of printf() and strcat() calls.

Hint:

        printf("CURLOPT_ERRORBUFFER - temp2 = ");
        printf(temp2);

can be written like this instead:

        printf("CURLOPT_ERRORBUFFER - temp2 = %s", temp2);

 From your pastebin source code:

                data = (char*)calloc(100, sizeof(char));

You are overflowing this buffer with the strcat() calls. Increase the
size and try again.

Linus
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-23