From c007e3915d5d6b81d90ffa1abf1b3343ec6449b0 Mon Sep 17 00:00:00 2001 From: Louis-Dominique Dubeau Date: Thu, 5 Jul 2018 15:20:55 -0400 Subject: [PATCH] fix: report processing instructions that do not have a target --- lib/saxes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/saxes.js b/lib/saxes.js index 509474de..9c88a70c 100644 --- a/lib/saxes.js +++ b/lib/saxes.js @@ -528,6 +528,9 @@ class SAXParser { case S_PI_ENDING: if (c === ">") { + if (this.piTarget.trim() === "") { + this.fail("Processing instruction without a target"); + } this.emitNode("onprocessinginstruction", { target: this.piTarget, body: this.piBody,