]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CURLOPT_ERRORBUFFER.md: the buffer is read only after curl takes ownership
authorMax Eliaser <eliaserm@elementaltechnologies.com>
Sat, 19 Apr 2025 21:08:06 +0000 (14:08 -0700)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 22 Apr 2025 06:40:42 +0000 (08:40 +0200)
Clarifies #17100
Closes #17105

docs/libcurl/opts/CURLOPT_ERRORBUFFER.md

index c8f75b161ed309bdbf2e1aae4353718ce5045e72..61bdab4d8af433586e4e20d284ad490519ec6014 100644 (file)
@@ -45,6 +45,10 @@ Since 7.60.0 libcurl initializes the contents of the error buffer to an empty
 string before performing the transfer. For earlier versions if an error code
 was returned but there was no error detail then the buffer was untouched.
 
+Do not attempt to set the contents of the buffer yourself, including in any
+callbacks you write that may be called by libcurl. The library may overwrite
+the buffer after your callback returns.
+
 Consider CURLOPT_VERBOSE(3) and CURLOPT_DEBUGFUNCTION(3) to better debug and
 trace why errors happen.