adm-zip
adm-zip copied to clipboard
TypeError: "size" argument must be a number
I have this error on generate zip. After some researches, i found that it's compress function. So, in zipFile line 270, I replaced var postHeader = Buffer.alloc(name); by var postHeader = Buffer.alloc(name.length,name) to fix this error;
I don't know if it's my node version or not. I use node 8.11.2
I have the same issue on node v9.8.0. That change also seems to fix the issue there.
I have the same issue on node v8.11.3. That change fixed issue.
Note that Buffer.from(name) also seems like it should fix the issue.
It looks like PRs to fix the issue have already been filed:
https://github.com/cthackers/adm-zip/pull/234 https://github.com/cthackers/adm-zip/pull/239
@cthackers It appears that the adm-zip<0.4.11 has a "high severity" vulnerability: https://snyk.io/vuln/npm:adm-zip:20180415; however, switching to 0.4.11 (we updated from 0.4.7: https://github.com/facebook/nuclide/commit/276f47aed6a62fa60443a8303a95a1101f453406) introduces this bug, so could we please get a new release with this bug fixed so we can upgrade to a secure version?