CURLOPT_INFILE doesn't allow reset for FTP
| Bug #64247 | CURLOPT_INFILE doesn't allow reset for FTP | ||||
|---|---|---|---|---|---|
| Submitted: | 2013-02-19 20:43 UTC | Modified: | 2014-04-29 08:03 UTC | ||
| From: | marco at m-s-d dot eu | Assigned: | mike (profile) | ||
| Status: | Closed | Package: | cURL related | ||
| PHP Version: | master-Git-2013-02-19 (Git) | OS: | Linux 3.0.0-1-amd64 #1 SMP | ||
| Private report: | No | CVE-ID: | None | ||
[2013-02-19 20:43 UTC] marco at m-s-d dot eu
Description: ------------ When trying to do a PUT request using CURLOPT_INFILE followed by a GET, then the GET will encounter a "Warning: curl_setopt_array(): supplied argument is not a valid File-Handle resource" if the file handle has been closed. This is a bug because you're supposed to free handles when you're not using them. Setting NULL like with CURLOPT_HEADERFUNCTION (see http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTHEADERFUNCTION) does not work, it gives "Warning: curl_setopt_array(): supplied argument is not a valid File-Handle resource". See also Bug #44866 - leaking FDs is bad, bad program practice. Test script: --------------- http://pastebin.com/XLJsZ9JH - line 44 is the CURLOPT_INFILE=>NULL line. Expected result: ---------------- Once CURLOPT_INFILE=>NULL has been set, I expect that the action of setting CURLOPT_INFILE=>$fp has been reversed (i.e. that curl has been reset to default),
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2013-06-16 23:46 UTC] stas@php.net
-Status: Open +Status: Feedback
[2013-06-16 23:46 UTC] stas@php.net
[2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
[2014-04-29 08:03 UTC] mike@php.net
-Assigned To: +Assigned To: mike
[2014-04-29 08:03 UTC] mike@php.net
-Status: No Feedback +Status: Assigned
[2014-04-30 07:30 UTC] mike@php.net
-Status: Assigned +Status: Closed