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,