We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7da1ea4 commit 82d71a8Copy full SHA for 82d71a8
NEWS
@@ -13,6 +13,10 @@ PHP NEWS
13
nielsdos)
14
. Fixed potential OOB when checking for trailing spaces on Windows. (cmb)
15
16
+- DOM:
17
+ . Fixed bug GH-17500 (Segfault with requesting nodeName on nameless doctype).
18
+ (nielsdos)
19
+
20
- Enchant:
21
. Fix crashes in enchant when passing null bytes. (nielsdos)
22
ext/dom/node.c
@@ -98,11 +98,17 @@ int dom_node_node_name_read(dom_object *obj, zval *retval)
98
}
99
case XML_DOCUMENT_TYPE_NODE:
100
case XML_DTD_NODE:
101
+ if (nodep->name) {
102
+ ZVAL_STRING(retval, (const char *) nodep->name);
103
+ } else {
104
+ ZVAL_EMPTY_STRING(retval);
105
+ }
106
+ break;
107
case XML_PI_NODE:
108
case XML_ENTITY_DECL:
109
case XML_ENTITY_REF_NODE:
110
case XML_NOTATION_NODE:
- ZVAL_STRING(retval, (char *) nodep->name);
111
+ ZVAL_STRING(retval, (constchar *) nodep->name);
112
break;
113
case XML_CDATA_SECTION_NODE:
114
ZVAL_STRING(retval, "#cdata-section");
ext/dom/tests/gh17500.phpt
@@ -0,0 +1,14 @@
1
+--TEST--
2
+GH-17500 (Segfault with requesting nodeName on nameless doctype)
3
+--EXTENSIONS--
4
+dom
5
+--FILE--
6
+<?php
7
8
+$doc = new DOMDocument();
9
+$doc->loadHTML("<!DOCTYPE>", LIBXML_NOERROR);
10
+var_dump($doc->doctype->nodeName);
11
12
+?>
+--EXPECT--
+string(0) ""
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments