Skip to content

Commit

Permalink
Fix other instances of prototype pollution vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
ashaffer committed Jan 19, 2022
1 parent dfc753a commit 40c73bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ function cachedPathRelative (from, to) {
// to invalidate the cache
var cwd = process.cwd()
if (cwd !== lastCwd) {
cache = {}
cache = Object.create(null)
lastCwd = cwd
}

if (cache[from] && cache[from][to]) return cache[from][to]

var result = relative.call(path, from, to)

cache[from] = cache[from] || {}
cache[from] = cache[from] || Object.create(null)
cache[from][to] = result

return result
Expand Down

0 comments on commit 40c73bf

Please sign in to comment.