From 326405df75fd6af3e7c6a0cbe7f2c2906eb96589 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Mon, 3 Jun 2013 08:55:54 -0400 Subject: [PATCH] another range check --- dom.d | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dom.d b/dom.d index 0b7eb5f..a04d35b 100644 --- a/dom.d +++ b/dom.d @@ -3569,6 +3569,11 @@ class Document : FileResource { enforce(data[pos] == '<'); pos++; + if(pos == data.length) { + if(strict) + throw new MarkupException("Found trailing < at end of file"); + // if not strict, we'll just skip the switch + } else switch(data[pos]) { // I don't care about these, so I just want to skip them case '!': // might be a comment, a doctype, or a special instruction