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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 20:01:29 2024 UTC