diff options
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | ext/dom/document.c | 2 | ||||
-rw-r--r-- | ext/dom/tests/bug77569.phpt | 14 |
3 files changed, 19 insertions, 1 deletions
@@ -9,6 +9,10 @@ PHP NEWS x86). (cmb) . Fixed bug #79248 (Traversing empty VT_ARRAY throws com_exception). (cmb) +- DOM: + . Fixed bug #77569: (Write Acess Violation in DomImplementation). (Nikita, + cmb) + - PCRE: . Fixed bug #79188 (Memory corruption in preg_replace/preg_replace_callback and unicode). (Nikita) diff --git a/ext/dom/document.c b/ext/dom/document.c index 9f9ce5e2f8..22bb90d5d8 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -339,7 +339,7 @@ int dom_document_encoding_write(dom_object *obj, zval *newval) str = zval_get_string(newval); - handler = xmlFindCharEncodingHandler(Z_STRVAL_P(newval)); + handler = xmlFindCharEncodingHandler(ZSTR_VAL(str)); if (handler != NULL) { xmlCharEncCloseFunc(handler); diff --git a/ext/dom/tests/bug77569.phpt b/ext/dom/tests/bug77569.phpt new file mode 100644 index 0000000000..f0f3566708 --- /dev/null +++ b/ext/dom/tests/bug77569.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #77569 (Write Acess Violation in DomImplementation) +--SKIPIF-- +<?php +if (!extension_loaded('dom')) die('skip dom extension not available'); +?> +--FILE-- +<?php +$imp = new DOMImplementation; +$dom = $imp->createDocument("", ""); +$dom->encoding = null; +?> +--EXPECTF-- +Warning: main(): Invalid Document Encoding in %s on line %d |