Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
var data = new Buffer(_entryHeader.size);
data.fill(0);
switch (_entryHeader.method) {
case Utils.Constants.STORED:
compressedData.copy(data);
if (!crc32OK(data)) {
if (async && callback) callback(data, Utils.Errors.BAD_CRC);
return Utils.Errors.BAD_CRC;
} else {
if (async && callback) callback(data);
return data;
}
break;
case Utils.Constants.DEFLATED:
var inflater = new Methods.Inflater(compressedData);
if (!async) {
inflater.inflate(data);
if (!crc32OK(data)) {
console.warn(Utils.Errors.BAD_CRC + " " + _entryName.toString());
}
return data;
} else {
inflater.inflateAsync(function(result) {
result.copy(data, 0);
if (crc32OK(data)) {
if (callback) callback(data, Utils.Errors.BAD_CRC);
} else {
if (callback) callback(data);
}
});
}