From 90e62b0e1bd8be118f40a9bd0e660f44e224ed47 Mon Sep 17 00:00:00 2001 From: Douglas Crockford Date: Wed, 5 Oct 2011 12:29:18 -0700 Subject: [PATCH] Bad XML --- JSONML.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/JSONML.java b/JSONML.java index 72a6ac1..936d16e 100755 --- a/JSONML.java +++ b/JSONML.java @@ -32,7 +32,7 @@ import java.util.Iterator; * JSONObject, and to covert a JSONArray or JSONObject into an XML text using * the JsonML transform. * @author JSON.org - * @version 2011-10-04 + * @version 2011-10-05 */ public class JSONML { @@ -66,6 +66,9 @@ public class JSONML { // while (true) { + if (!x.more()) { + throw x.syntaxError("Bad XML"); + } token = x.nextContent(); if (token == XML.LT) { token = x.nextToken();