|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30475 Curl curl_getinfo()
Submitted: 2004-10-18 23:02 UTC Modified: 2004-10-19 00:43 UTC
From: mikeb at xamo dot com Assigned:
Status: Closed Package: cURL related
PHP Version: 5.0.2 OS: FreeBSD 4.8
Private report: No CVE-ID:
 [2004-10-18 23:02 UTC] mikeb at xamo dot com
When requesting the CURLINFO_CONTENT_TYPE using curl_getinfo(), if there is an error (such as connection error) or missing header for any reason, running the function using specifically curl_getinfo($fd,CURLINFO_CONTENT_TYPE) will cause a PHP core dump.

The problem seems to be that the function does not check for the instance of the Content-Type: header before it tries to parse it.

Temporary workaround is simply not using the function, and parsing for the data yourself.

Reproduce code:

// the following line will cause a core dump
//    as does not return an appropriate Content-Type header. Also happens on connect errors.


Expected result:
Should return content-type in the HTTP Header (if it exists, or false/empty string if it doesnt exist)

Actual result:
PHP Core Dump.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-19 00:43 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Mon Nov 30 20:01:36 2015 UTC