curl.h: remove the struct pointer for CURL/CURLSH/CURLM typedefs

It makes the callbacks get different signnatures when used from within
libcurl vs outside of it by libcurl-using applications (such as the
libtests) and this triggers UndefinedBehaviorSanitizer errors.

Closes #15289
This commit is contained in:
Daniel Stenberg 2024-10-14 14:09:59 +02:00
parent ad1c49bc0e
commit eed3c8f4b7
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
15 changed files with 98 additions and 74 deletions

View file

@ -29,6 +29,8 @@
#include <curl/curl.h>
struct Curl_easy;
#include "urldata.h"
#include "warnless.h"
#include "escape.h"
@ -53,7 +55,7 @@ char *curl_unescape(const char *string, int length)
/* Escapes for URL the given unescaped string of given length.
* 'data' is ignored since 7.82.0.
*/
char *curl_easy_escape(struct Curl_easy *data, const char *string,
char *curl_easy_escape(CURL *data, const char *string,
int inlength)
{
size_t length;
@ -176,7 +178,7 @@ CURLcode Curl_urldecode(const char *string, size_t length,
* If olen == NULL, no output length is stored.
* 'data' is ignored since 7.82.0.
*/
char *curl_easy_unescape(struct Curl_easy *data, const char *string,
char *curl_easy_unescape(CURL *data, const char *string,
int length, int *olen)
{
char *str = NULL;