Skip to content

potential null deref in htmlparser.js #3

@sgbeal

Description

@sgbeal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions