mirror of https://github.com/adamdruppe/arsd.git
fix segfault on bad xml
This commit is contained in:
parent
4218146d6e
commit
51747d64ba
7
dom.d
7
dom.d
|
@ -1133,7 +1133,8 @@ class Document : FileResource, DomParent {
|
||||||
} while (r.type != 0 || r.element.nodeType != 1); // we look past the xml prologue and doctype; root only begins on a regular node
|
} while (r.type != 0 || r.element.nodeType != 1); // we look past the xml prologue and doctype; root only begins on a regular node
|
||||||
|
|
||||||
root = r.element;
|
root = r.element;
|
||||||
root.parent_ = this;
|
if(root !is null)
|
||||||
|
root.parent_ = this;
|
||||||
|
|
||||||
if(!strict) // in strict mode, we'll just ignore stuff after the xml
|
if(!strict) // in strict mode, we'll just ignore stuff after the xml
|
||||||
while(r.type != 4) {
|
while(r.type != 4) {
|
||||||
|
@ -8012,6 +8013,10 @@ unittest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unittest {
|
||||||
|
auto document = new Document("broken"); // just ensuring it doesn't crash
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright: Adam D. Ruppe, 2010 - 2021
|
Copyright: Adam D. Ruppe, 2010 - 2021
|
||||||
License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
|
License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
|
||||||
|
|
Loading…
Reference in New Issue