Repository navigation
🐛 Stop a malformed zip64 record bypassing the error event - #114
alecgibson wants to merge 1 commit into
Conversation
Fixes antelle#112 At the moment, a crafted archive can make the central-directory reader throw synchronously from inside an `fs.read` callback, which surfaces as an `uncaughtException` rather than an `error` event. A caller with correct error handling still has its process taken down by a malformed file. `op.complete` is assigned three completion handlers, and only one of them — `readCentralDirectoryComplete` — guards itself. Since all three are reached through the single `op.complete()` call in `readUntilFoundCallback`, guarding that one statement covers every path, and any handler added later. That leaves the try/catch in `readCentralDirectoryComplete` redundant, but removing it would mean re-indenting the whole function, so it stays. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
A few notes on what this deliberately leaves alone, so the scope is visible without
File descriptors on the error path are untouched here. A fatal error before Heads up on a conflict: #113 also adds a Also filed #117 while tracing the reader: The three new tests each fail against |
Fixes #112
At the moment, a crafted archive can make the central-directory reader throw synchronously from inside an
fs.readcallback, which surfaces as anuncaughtExceptionrather than anerrorevent. A caller with correct error handling still has its process taken down by a malformed file.op.completeis assigned three completion handlers, and only one of them —readCentralDirectoryComplete— guards itself. Since all three are reached through the singleop.complete()call inreadUntilFoundCallback, guarding that one statement covers every path, and any handler added later. That leaves the try/catch inreadCentralDirectoryCompleteredundant, but removing it would mean re-indenting the whole function, so it stays.🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com