Skip to content

Error when plain object in a value #33

@dougwilson

Description

@dougwilson

brief reproduction (from expressjs/connect-multiparty#11 (comment)):

$ node -pe 'o=Object.create(null);o.r=4;require("qs").parse({"a": o})'

node_modules\qs\lib\utils.js:47
        if (source.hasOwnProperty(i)) {
                   ^
TypeError: Object object has no method 'hasOwnProperty'
    at Object.exports.clone (node_modules\qs\lib\utils.js:47:20)
    at Object.exports.clone (node_modules\qs\lib\utils.js:48:31)
    at Object.module.exports [as parse] (node_modules\qs\lib\parse.js:141:89)
    at [eval]:1:43
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:536:25)
    at startup (node.js:80:7)
    at node.js:906:3

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions