php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30973 segfault when accessing wrong url and get CURLINFO_CONTENT_TYPE
Submitted: 2004-12-03 10:46 UTC Modified: 2004-12-03 10:49 UTC
From: alberty at neptunelabs dot com Assigned:
Status: Closed Package: cURL related
PHP Version: 4.3.9 OS: linux_i686
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alberty at neptunelabs dot com
New email:
PHP Version: OS:

 

 [2004-12-03 10:46 UTC] alberty at neptunelabs dot com
Description:
------------
If you get a wrong url and get the content type via curl_getinfo($ch, CURLINFO_CONTENT_TYPE); the cURL extention crashes with a segfault.



patch:
1213c1213,1215
<                       RETURN_STRING(s_code, 1);
---
>                       if (s_code){
>                               RETURN_STRING(s_code, 1);
>                       }


Regards,

Steve

Reproduce code:
---------------
<?php
$ch = curl_init ('http://www.totallywrongdomain.com/');
if ($ch){
	$result=curl_exec ($ch);
	$returnvalue['content_type']=curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
	curl_close ($ch);
}
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-03 10:49 UTC] alberty at neptunelabs dot com
Okay, i've seen that's fixed in 4.3.10
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 11:01:31 2025 UTC