Skip to content

Commit

Permalink
Ignore potentially unsafe files
Browse files Browse the repository at this point in the history
  • Loading branch information
BRKurek committed Apr 27, 2019
1 parent 52237e3 commit 4f85851
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function Parse () {
me._stream = new BlockStream(512)
me.position = 0
me._ended = false
me._entries = []

me._stream.on("error", function (e) {
me.emit("error", e)
Expand Down Expand Up @@ -250,7 +251,16 @@ Parse.prototype._startEntry = function (c) {

if (onend) entry.on("end", onend)

if (entry.type === "File") {
this._entries.forEach(function(prevEntry) {
if (prevEntry.type === "Link" && prevEntry.path === entry.path) {
ev = "ignoredEntry"
}
})
}

this._entry = entry
this._entries.push(entry)
var me = this

entry.on("pause", function () {
Expand Down

0 comments on commit 4f85851

Please sign in to comment.