|  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: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mikeb at xamo dot com
New email:
PHP Version: OS:


 [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-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 01 04:01:29 2023 UTC