jeresig/env-js

potential null deref in htmlparser.js

sgbeal opened this issue · 0 comments

a pedantic note regarding htmlparser.js:

            if ( !doc ) {
                    if ( typeof DOMDocument != "undefined" )
                            doc = new DOMDocument();
                    else if ( typeof document != "undefined" && document.implementation && document.implementation.createDocument )
                            doc = document.implementation.createDocument("", "", null);
                    else if ( typeof ActiveX != "undefined" )
                            doc = new ActiveXObject("Msxml.DOMDocument");
            } else

that will dereference a null doc a few lines down if it cannot instantiate doc. It "should" have a final else which throws an exception.