[Pkg-javascript-commits] [node-expat] 234/371: setUnknownEncoding(): don't crash on unsuspecting people

Jonas Smedegaard dr at jones.dk
Sun Feb 28 10:00:10 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository node-expat.

commit 3e3e6649f130bbdbf8267320908eaf8293c16afe
Author: Astro <astro at spaceboyz.net>
Date:   Tue Jan 7 03:44:43 2014 +0100

    setUnknownEncoding(): don't crash on unsuspecting people
---
 node-expat.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/node-expat.cc b/node-expat.cc
index 69187f0..dc71841 100644
--- a/node-expat.cc
+++ b/node-expat.cc
@@ -449,6 +449,9 @@ private:
     Parser *parser = ObjectWrap::Unwrap<Parser>(args.This());
     NanScope();
 
+    if (!parser->xmlEncodingInfo)
+      NanThrowError("setUnknownEncoding() must be synchronously invoked from an unknownEncoding event handler");
+
     if (args.Length() >= 1 && args[0]->IsArray()) {
       Local<Array> map = args[0].As<Array>();
       /* Copy map */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-expat.git



More information about the Pkg-javascript-commits mailing list