Skip to content

Commit 4f85851

Browse files
committedApr 27, 2019
Ignore potentially unsafe files
1 parent 52237e3 commit 4f85851

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎lib/parse.js

+10
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ function Parse () {
3838
me._stream = new BlockStream(512)
3939
me.position = 0
4040
me._ended = false
41+
me._entries = []
4142

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

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

254+
if (entry.type === "File") {
255+
this._entries.forEach(function(prevEntry) {
256+
if (prevEntry.type === "Link" && prevEntry.path === entry.path) {
257+
ev = "ignoredEntry"
258+
}
259+
})
260+
}
261+
253262
this._entry = entry
263+
this._entries.push(entry)
254264
var me = this
255265

256266
entry.on("pause", function () {

0 commit comments

Comments
 (0)
Please sign in to comment.