curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Periodic segfault in curl_easy_perform()

From: Tomalak Geret'kal via curl-library <>
Date: Tue, 9 Mar 2021 19:52:06 +0000

On 09/03/2021 19:48, Adrián Gimeno Balaguer wrote:
> I had been passing a pointer of an unrelated type to
> curl_easy_setopt
> (to set CURLOPT_POST), instead of the proper CURL handle. I've just
> removed the call since the POST should be enabled already when
> supplying POST fields (which I do). Apparently I had introduced the
> bug inadvertently since +3 months ago.
> But how is it possible that the compiler doesn't complain of that
> misuse? (Even if curl_easy_setop is wrapped by a macro; a CURL handle
> is required in the function call).
Looking at curl.h, unless CURL_STRICTER is defined, then
CURL* is just a void*.

Assuming your program is written in C, pointers can
therefore convert implicitly to CURL*.

Glad you got it sorted!

Received on 2021-03-09