diff --git a/NEWS b/NEWS index 39eec5e74b9..1a7af0a2eb1 100644 --- a/NEWS +++ b/NEWS @@ -82,6 +82,7 @@ PHP NEWS - Tidy: . Fixed GH-19021 (improved tidyOptGetCategory detection). (arjendekorte, David Carlier, Peter Kokot) + . Fix UAF in tidy when tidySetErrorBuffer() fails. (nielsdos) - XMLReader: . Fix arginfo/zpp violations when LIBXML_SCHEMAS_ENABLED is not available. diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index ab991b2f8b7..da0eb877d58 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -447,7 +447,7 @@ static zend_object *tidy_object_new(zend_class_entry *class_type, zend_object_ha efree(intern->ptdoc->errbuf); tidyRelease(intern->ptdoc->doc); efree(intern->ptdoc); - efree(intern); + /* TODO: convert to exception */ php_error_docref(NULL, E_ERROR, "Could not set Tidy error buffer"); }