From: Jay Satiro Date: Thu, 5 Jan 2023 07:14:53 +0000 (-0500) Subject: CURLOPT_HEADERDATA.3: warn DLL users must set write function X-Git-Tag: curl-7_88_0~159 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d7b56ac75cd6e2ec6d501780e46f8bb3046ebd9f;p=thirdparty%2Fcurl.git CURLOPT_HEADERDATA.3: warn DLL users must set write function - Warn that in Windows if libcurl is running from a DLL and if CURLOPT_HEADERDATA is set then CURLOPT_WRITEFUNCTION or CURLOPT_HEADERFUNCTION must be set as well, otherwise the user may experience crashes. We already have a similar warning in CURLOPT_WRITEDATA. Basically, in Windows libcurl could crash writing a FILE pointer that was created by a different C runtime. In Windows each DLL that is part of a program may or may not have its own C runtime. Ref: https://github.com/curl/curl/issues/10231 Closes https://github.com/curl/curl/pull/10233 --- diff --git a/docs/libcurl/opts/CURLOPT_HEADERDATA.3 b/docs/libcurl/opts/CURLOPT_HEADERDATA.3 index a6e7c59819..7311f2dce7 100644 --- a/docs/libcurl/opts/CURLOPT_HEADERDATA.3 +++ b/docs/libcurl/opts/CURLOPT_HEADERDATA.3 @@ -40,6 +40,10 @@ If \fICURLOPT_WRITEFUNCTION(3)\fP or \fICURLOPT_HEADERFUNCTION(3)\fP is used, If neither of those options are set, \fIpointer\fP must be a valid FILE * and it will be used by a plain fwrite() to write headers to. + +If you are using libcurl as a win32 DLL, you \fBMUST\fP use a +\fICURLOPT_WRITEFUNCTION(3)\fP or \fICURLOPT_HEADERFUNCTION(3)\fP if you set +this option or you will experience crashes. .SH DEFAULT NULL .SH PROTOCOLS