php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56127 Segmentation Fault when using tidy_repair_string with Curl
Submitted: 2004-07-11 07:50 UTC Modified: 2011-11-16 00:25 UTC
From: mj@php.net Assigned: felipe (profile)
Status: Closed Package: *General Issues
PHP Version: 5CVS-2004-07-11 (dev) OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mj@php.net
New email:
PHP Version: OS:

 

 [2004-07-11 07:50 UTC] mj@php.net
Description:
------------
Passing the return value of curl_exec() to tidy_repair_string() causes a segmentation fault. I'm using Curl 7.12.0 and the latest tidylib version from tidy.sf.net.

See below for the code and a backtrace.

Reproduce code:
---------------
<?php
$ch = curl_init("http://php.net/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$str = curl_exec($ch);
curl_close($ch);

echo tidy_repair_string($str);

Actual result:
--------------
#0  0x0820c3f0 in php_tidy_quick_repair (ht=1, return_value=0x83f3bec, this_ptr=0x0, return_value_used=1, is_file=0 '\0') at /home/martin/cvs/php-src/ext/tidy/tidy.c:432
#1  0x0820ef5d in zif_tidy_repair_string (ht=1, return_value=0x83f3bec, this_ptr=0x0, return_value_used=1) at /home/martin/cvs/php-src/ext/tidy/tidy.c:1126
#2  0x082a167c in zend_do_fcall_common_helper (execute_data=0xbfffd6bc, opline=0x8404d88, op_array=0x840052c) at /home/martin/cvs/php-src/Zend/zend_execute.c:2699
#3  0x082a1e49 in zend_do_fcall_handler (execute_data=0xbfffd6bc, opline=0x8404d88, op_array=0x840052c) at /home/martin/cvs/php-src/Zend/zend_execute.c:2828
#4  0x0829d5bb in execute (op_array=0x840052c) at /home/martin/cvs/php-src/Zend/zend_execute.c:1391
#5  0x08276cb4 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/martin/cvs/php-src/Zend/zend.c:1061
#6  0x0822aebf in php_execute_script (primary_file=0xbffffa60) at /home/martin/cvs/php-src/main/main.c:1627
#7  0x082ac20f in main (argc=3, argv=0xbffffae4) at /home/martin/cvs/php-src/sapi/cli/php_cli.c:943


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-16 00:25 UTC] felipe@php.net
Looks as this old problem is already fixed. :)
 [2011-11-16 00:25 UTC] felipe@php.net
-Status: Open +Status: Closed -Package: tidy +Package: *General Issues -Assigned To: +Assigned To: felipe
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 20:01:35 2025 UTC