- Fixed bug #54682 (Tidy::diagnose() NULL pointer dereference)

This commit is contained in:
Felipe Pena 2011-11-15 15:16:20 +00:00
parent 7cac52f58f
commit bb6835f727
3 changed files with 18 additions and 1 deletions

4
NEWS
View file

@ -27,6 +27,10 @@ PHP NEWS
- SOAP
. Fixed bug #44686 (SOAP-ERROR: Parsing WSDL with references). (Dmitry)
- Tidy:
. Fixed bug #54682 (Tidy::diagnose() NULL pointer dereference).
(Maksymilian Arciemowicz, Felipe)
03 Nov 2011, PHP 5.3.9RC1

View file

@ -0,0 +1,13 @@
--TEST--
Tidy::diagnose() NULL pointer dereference
--SKIPIF--
<?php if (!extension_loaded("tidy")) print "skip"; ?>
--FILE--
<?php
$nx = new Tidy("*");
$nx->diagnose();
?>
--EXPECTF--
Warning: tidy::__construct(): Cannot Load '*' into memory in %s on line %d

View file

@ -1288,7 +1288,7 @@ static PHP_FUNCTION(tidy_diagnose)
{
TIDY_FETCH_OBJECT;
if (tidyRunDiagnostics(obj->ptdoc->doc) >= 0) {
if (tidyStatus(obj->ptdoc->doc) != 0 && tidyRunDiagnostics(obj->ptdoc->doc) >= 0) {
tidy_doc_update_properties(obj TSRMLS_CC);
RETURN_TRUE;
}