summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/tar/lib
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/tar/lib')
-rw-r--r--deps/npm/node_modules/tar/lib/parse.js7
-rw-r--r--deps/npm/node_modules/tar/lib/read-entry.js4
2 files changed, 10 insertions, 1 deletions
diff --git a/deps/npm/node_modules/tar/lib/parse.js b/deps/npm/node_modules/tar/lib/parse.js
index 34e3cd70c2..43d4383dda 100644
--- a/deps/npm/node_modules/tar/lib/parse.js
+++ b/deps/npm/node_modules/tar/lib/parse.js
@@ -102,7 +102,12 @@ module.exports = warner(class Parser extends EE {
}
[CONSUMEHEADER] (chunk, position) {
- const header = new Header(chunk, position, this[EX], this[GEX])
+ let header
+ try {
+ header = new Header(chunk, position, this[EX], this[GEX])
+ } catch (er) {
+ return this.warn('invalid entry', er)
+ }
if (header.nullBlock)
this[EMIT]('nullBlock')
diff --git a/deps/npm/node_modules/tar/lib/read-entry.js b/deps/npm/node_modules/tar/lib/read-entry.js
index aa369c74f5..8acee94bac 100644
--- a/deps/npm/node_modules/tar/lib/read-entry.js
+++ b/deps/npm/node_modules/tar/lib/read-entry.js
@@ -6,6 +6,10 @@ const SLURP = Symbol('slurp')
module.exports = class ReadEntry extends MiniPass {
constructor (header, ex, gex) {
super()
+ // read entries always start life paused. this is to avoid the
+ // situation where Minipass's auto-ending empty streams results
+ // in an entry ending before we're ready for it.
+ this.pause()
this.extended = ex
this.globalExtended = gex
this.header = header