adm-zip icon indicating copy to clipboard operation
adm-zip copied to clipboard

TypeError: "value" argument is out of bounds

Open GrayDelacluyse opened this issue 7 years ago • 8 comments
trafficstars

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 () at Object.compressToBuffer (.../node_modules/adm-zip/zipFile.js:182:23) at Object.writeZip (.../node_modules/adm-zip/adm-zip.js:535:32) at db.bjServicesExport.then.x (.../build/services/TaskProcessorService.js:60:20) at at process._tickCallback (internal/process/next_tick.js:188:7)

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!

GrayDelacluyse avatar May 02 '18 17:05 GrayDelacluyse

I also experienced the same issue, and your fix worked for me as well.

Running 64-bit Windows 10.

ransoing avatar May 03 '18 04:05 ransoing

I also experienced the same issue, and i back to use [email protected]

Running on CentOS Linux release 7.2.1511 (Core)

fanfeilong avatar May 04 '18 12:05 fanfeilong

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

Homeroe avatar May 07 '18 19:05 Homeroe

this issue is also reproduction in:

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.

fanfeilong avatar May 09 '18 07:05 fanfeilong

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

zekenie avatar May 10 '18 16:05 zekenie

This is a show stopper. Any chance of shipping this soon? We are running node 6 and Linux.

terrisgit avatar May 12 '18 02:05 terrisgit

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.

jmcollin78 avatar May 12 '18 07:05 jmcollin78

We're seeing the same problem on [email protected] on electron@^1.7.5

musclejack avatar Jun 13 '18 10:06 musclejack