adm-zip
adm-zip copied to clipboard
TypeError: "value" argument is out of bounds
I was receiving an exception when adding certain files.
TypeError: "value" argument is out of bounds
at checkInt (buffer.js:1180:11)
at Buffer.writeInt32LE (buffer.js:1370:5)
at Object.entryHeaderToBinary (.../node_modules/adm-zip/headers/entryHeader.js:217:18)
at Object.packHeader (.../node_modules/adm-zip/zipEntry.js:260:39)
at .../node_modules/adm-zip/zipFile.js:198:41
at Array.forEach (
Digging into the adm-zip code, I noticed on entryHeaderToBinary in entryHeader.js the following line: data.writeInt32LE(_crc, Constants.CENCRC); This seems inconsistent sine on read _crc is data.readUInt32LE(Constants.CENCRC);
After changing the line to write an Unsigned Int, the problem was fixed.
I have not put in a pull request, because I was curious how I could be the first one to run into this and if I was missing something else.
Thanks!
I also experienced the same issue, and your fix worked for me as well.
Running 64-bit Windows 10.
I also experienced the same issue, and i back to use [email protected]
Running on CentOS Linux release 7.2.1511 (Core)
Can confirm the issue. Couldn't rollback to 0.4.7 because zipped files were zipped as folders instead of files.
GrayDelacluyse solutions worked for me too.
I was compressing CVS files, if anything. Running on Debian 9 and NodeJs 6.12
this issue is also reproduction in:
- node v10.0.1
- [email protected]
when install node in mac os by brew install , the node version is latest, which will lead the adm-zip to crash into TypeError: "value" argument is out of bounds.
We're seeing the same problem on both [email protected] and 0.4.9 on node 8.11.x. But, when we downgrade to node 8.5.x and [email protected], the problem is gone
This is a show stopper. Any chance of shipping this soon? We are running node 6 and Linux.
I've make a fork to have a chance to continue with this project. It's available here: https://github.com/jmcollin78/adm-zip and you should install it with: npm install adm-zip-jmcnet
It has been made for fixing issue 218 but it seems that it's the same bug origin.
Try this and let me know.
We're seeing the same problem on [email protected] on electron@^1.7.5