You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
multipartBodyParser crash if mapping files array #1819
Searched both open and closed issues for duplicates of this issue
Title adequately and concisely reflects the feature or the bug
Bug Report
Restify Version
8.5.1
Node.js Version
v10.15.1
Expected behaviour
No crash
Actual behaviour
Crash stack:
NodeError: The "path" argument must be one of type string, Buffer, or URL. Received type undefined
at Object.readFile (fs.js:297:3)
at forEach (/Users/guoyi/git/testServer/node_modules/restify/lib/plugins/multipartBodyParser.js:120:28)
at Array.forEach ()
at parse (/Users/guoyi/git/testServer/node_modules/restify/lib/plugins/multipartBodyParser.js:115:40)
at IncomingForm. (/Users/guoyi/git/testServer/node_modules/formidable/lib/incoming_form.js:107:9)
at IncomingForm.emit (events.js:189:13)
at IncomingForm._maybeEnd (/Users/guoyi/git/testServer/node_modules/formidable/lib/incoming_form.js:557:8)
at /Users/guoyi/git/testServer/node_modules/formidable/lib/incoming_form.js:238:12
at WriteStream. (/Users/guoyi/git/testServer/node_modules/formidable/lib/file.js:79:5)
at Object.onceWrapper (events.js:277:13)
Repro case
server side:
const restify = require('restify');
const server = restify.createServer({
name: 'Test Server',
maxParamLength: 1024,
});
Activity
Fix a crash in multipartBodyParser if mapping files array restify#1819
[-]multipartBodyParser crash if mapFiles is true[/-][+]multipartBodyParser crash if mapping files array[/+]guoyibj commentedon Jun 30, 2020
testServer.zip
testClient.zip