php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40611 cURL memory error
Submitted: 2007-02-23 18:05 UTC Modified: 2007-02-26 09:14 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: zamorov at edinorog dot ru Assigned: tony2001 (profile)
Status: Closed Package: cURL related
PHP Version: 4CVS-2007-02-23 (snap) OS: FreeBSD 4.11
Private report: No CVE-ID: None
 [2007-02-23 18:05 UTC] zamorov at edinorog dot ru
Description:
------------
cURL 1.15.5, 1.16.0 and 1.16.1

Got many error in log if request site with empty body.

Sample:
http://bar-navig.yandex.ru/u?sample=test

HTTP/1.1 200 Ok
Connection: close
Cache-control: no-cache, max-age=0
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Content-Type: text/html; charset=windows-1251

and no body.

Reproduce code:
---------------
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_USERAGENT, '');
curl_setopt($curl, CURLOPT_URL, 'http://bar-navig.yandex.ru/u?sample=test');
$return = curl_exec($curl);

echo (curl_errno($this->Curl) == 0) ? 'ok' : 'error';
?>

Expected result:
----------------
error.log

many lines with
httpd in free(): warning: page is already free
httpd in free(): warning: chunk is already free
and
Integer overflow in memory_limit check detected

Actual result:
--------------
Zero page.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-23 20:53 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2007-02-24 10:28 UTC] zamorov at edinorog dot ru
I get snapshot build on Feb 24, 2007 09:30 GMT
Memory bug still not fixed.

Add before:
curl_setopt($curl, CURLOPT_URL,
'http://bar-navig.yandex.ru/u?sample=test');
$return = curl_exec($curl);

this line
curl_setopt($curl, CURLOPT_URL, 'http://bar-navig.yandex.ru/u?ver=2&lang=1049&ur
l=www.php.net&target=_No__Name:5&show=1&thc=0');
$return = curl_exec($curl);

and reload a script of 10-20 times.
 [2007-02-26 09:14 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC