Skip to content

Commit 90fb875

Browse files
committed
fixed 'End of data reached' error when file extra field is invalid
1 parent 7f9d022 commit 90fb875

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

dist/jszip.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3949,7 +3949,7 @@ ZipEntry.prototype = {
39493949
this.extraFields = {};
39503950
}
39513951

3952-
while (reader.index < end) {
3952+
while (reader.index + 4 < end) {
39533953
extraFieldId = reader.readInt(2);
39543954
extraFieldLength = reader.readInt(2);
39553955
extraFieldValue = reader.readData(extraFieldLength);
@@ -3960,6 +3960,8 @@ ZipEntry.prototype = {
39603960
value: extraFieldValue
39613961
};
39623962
}
3963+
3964+
reader.setIndex(end);
39633965
},
39643966
/**
39653967
* Apply an UTF8 transformation if needed.

0 commit comments

Comments
 (0)