mirror of https://github.com/lukechilds/node.git
Browse Source
This fixes a potential Buffer(num) call when the user passes a number as the 'auth' property. This now throws instead of allocating an unitialized memory Buffer and sending that in the Authorization header. Fixes: https://github.com/nodejs/security/issues/111 PR-URL: https://github.com/nodejs/node-private/pull/83 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>v4.x
Сковорода Никита Андреевич
8 years ago
committed by
Myles Borins
2 changed files with 14 additions and 1 deletions
@ -0,0 +1,13 @@ |
|||
'use strict'; |
|||
|
|||
require('../common'); |
|||
const http = require('http'); |
|||
const url = require('url'); |
|||
const assert = require('assert'); |
|||
|
|||
const opts = url.parse('http://127.0.0.1:8180'); |
|||
opts.auth = 100; |
|||
|
|||
assert.throws(() => { |
|||
http.get(opts); |
|||
}, /^TypeError: "value" argument must not be a number$/); |
Loading…
Reference in new issue