-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
if CURLOPT_OPENSOCKETFUNCTION callback sets CURLOPT_ERRORBUFFER string, string will be overwritten #17100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am tentatively classifying this issue as a regression in the LibCURL, introduced in the 7.88 release. I checked the known bugs list and open GitHub issues and did not find anything that looks like a match. Urgency and expectationsI am not immediately blocked by this issue and I'm not demanding a fix right away or anything. I am able to work around it. If you elect not to prioritize this issue, that is fine-- I just need a ticket I can reference to explain why I am applying a workaround in our codebase, hence why I am filing this. Regardless of your decision we remain grateful for your efforts on this crucial piece of Internet infrastructure. To Reproduce
Expected resultThe Actual resultThe Operating systemI have demonstrated this issue on AmazonLinux 2023 using the packaged libcurl. I have also demonstrated the issue on AmazonLinux 2 and Ubuntu 20.04 using my own compiled libcurl. All of this testing was done using various x86_64 machines. Bisect resultI have bisected this to commit 71b7e01 (lib: connect/h2/h3 refactor) I believe this commit was released in CURL 7.88.x. I skimmed the changelog at https://curl.se/changes.html#7_88_0 and I could not find anything to suggest that this change was intentional. I also compared the docs using curl-7_87_0...curl-7_88_0 and Demo programI have written a short, but complete C program to demonstrate the issue.
Example good output:
Example bad output:
Mild debuggingI have used
|
I don't think libcurl gives any promises that allow the application to update the error buffer like this without the risk that the library overwrites it. The error buffer is intended to be used by libcurl itself. I think you should use a separate buffer for your application's own needs. |
… ownership of it. Clarifies curl#17100
Thank you for the explanation. I have put up a simple documentation patch (pr #17105) to add this information. |
Docs update #17105 merged |
…rship Clarifies curl#17100 Closes curl#17105
…rship Clarifies curl#17100 Closes curl#17105
I did this
CURLOPT_ERRORBUFFER
option to a char arrayCURLOPT_OPENSOCKETFUNCTION
callbackCURLOPT_ERRORBUFFER
buffer and then returnCURL_SOCKET_BAD
I expected the following
The
CURLOPT_ERRORBUFFER
buffer should contain the string set by theCURLOPT_OPENSOCKETFUNCTION
aftercurl_easy_perform
has returnedcurl/libcurl version
I have bisected this to commit 71b7e01 (lib: connect/h2/h3 refactor)
I believe this commit was released in CURL 7.88.x. I skimmed the changelog at https://curl.se/changes.html#7_88_0 and I could not find anything to suggest that this change was intentional. I also compared the docs using curl-7_87_0...curl-7_88_0 and
git diff curl-7_87_0...curl-7_88_0 -- docs/libcurl/
and I also could not find anything there to suggest this change was intentional. Perhaps I missed something though.operating system
I have demonstrated this issue on AmazonLinux 2023 using the packaged libcurl. I have also demonstrated the issue on AmazonLinux 2 and Ubuntu 20.04 using my own compiled libcurl. All of this testing was done using various x86_64 machines.
The text was updated successfully, but these errors were encountered: