php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46055 Tidy crashes when no document is supplied
Submitted: 2008-09-11 15:42 UTC Modified: 2008-09-11 23:46 UTC
From: felipe@php.net Assigned:
Status: Not a bug Package: Tidy (PECL)
PHP Version: 5.3CVS-2008-09-11 (CVS) OS: *
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: felipe@php.net
New email:
PHP Version: OS:

 

 [2008-09-11 15:42 UTC] felipe@php.net
Description:
------------
See below.

Reproduce code:
---------------
1)

<?php

$x = new tidynode;
$x->getparent();

---
2)

<?php

$x = new tidy;
$x->diagnose();

---
etc



Actual result:
--------------
1)
==32570== Invalid read of size 4
==32570==    at 0x41823CE: tidyGetParent (in /usr/lib/libtidy-0.99.so.0.0.0)
==32570==    by 0x838679D: zif_tnm_getParent (tidy.c:1803)
==32570==    by 0x845468F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:315)
==32570==    by 0x84427B2: execute (zend_vm_execute.h:104)
==32570==    by 0x841CC2E: zend_execute_scripts (zend.c:1197)
==32570==    by 0x83C22CC: php_execute_script (main.c:2075)
==32570==    by 0x84B4C0C: main (php_cli.c:1130)
==32570==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32570== 
==32570== Process terminating with default action of signal 11 (SIGSEGV)
==32570==  Access not within mapped region at address 0x0
==32570==    at 0x41823CE: tidyGetParent (in /usr/lib/libtidy-0.99.so.0.0.0)
==32570==    by 0x838679D: zif_tnm_getParent (tidy.c:1803)
==32570==    by 0x845468F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:315)
==32570==    by 0x84427B2: execute (zend_vm_execute.h:104)
==32570==    by 0x841CC2E: zend_execute_scripts (zend.c:1197)
==32570==    by 0x83C22CC: php_execute_script (main.c:2075)
==32570==    by 0x84B4C0C: main (php_cli.c:1130)


2)
==32580== Invalid read of size 4
==32580==    at 0x4179D53: ReportMarkupVersion (in /usr/lib/libtidy-0.99.so.0.0.0)
==32580==    by 0x41819AC: tidyDocRunDiagnostics (in /usr/lib/libtidy-0.99.so.0.0.0)
==32580==    by 0x41819DC: tidyRunDiagnostics (in /usr/lib/libtidy-0.99.so.0.0.0)
==32580==    by 0x8386428: zif_tidy_diagnose (tidy.c:1319)
==32580==    by 0x845468F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:315)
==32580==    by 0x84427B2: execute (zend_vm_execute.h:104)
==32580==    by 0x841CC2E: zend_execute_scripts (zend.c:1197)
==32580==    by 0x83C22CC: php_execute_script (main.c:2075)
==32580==    by 0x84B4C0C: main (php_cli.c:1130)
==32580==  Address 0x1C is not stack'd, malloc'd or (recently) free'd
==32580== 
==32580== Process terminating with default action of signal 11 (SIGSEGV)
==32580==  Access not within mapped region at address 0x1C
==32580==    at 0x4179D53: ReportMarkupVersion (in /usr/lib/libtidy-0.99.so.0.0.0)
==32580==    by 0x41819AC: tidyDocRunDiagnostics (in /usr/lib/libtidy-0.99.so.0.0.0)
==32580==    by 0x41819DC: tidyRunDiagnostics (in /usr/lib/libtidy-0.99.so.0.0.0)
==32580==    by 0x8386428: zif_tidy_diagnose (tidy.c:1319)
==32580==    by 0x845468F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:315)
==32580==    by 0x84427B2: execute (zend_vm_execute.h:104)
==32580==    by 0x841CC2E: zend_execute_scripts (zend.c:1197)
==32580==    by 0x83C22CC: php_execute_script (main.c:2075)
==32580==    by 0x84B4C0C: main (php_cli.c:1130)



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-11 23:46 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Its an internal bug of the tidy library, it lacks basic checks to ensure 
that the provided struct is containing data.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 19:01:29 2024 UTC