Skip to content

Commit

Permalink
fix: throw error for too long tar entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Cafe137 committed Oct 24, 2024
1 parent 6997d0c commit 4ce5ca6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/tar.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export class TarStream {
}

beginFile(path: string, size: number) {
if (path.length > 100) {
throw new Error(`File name too long: ${path}`)
}
const header = createHeader(path, size)
this.pieces.push(header)
this.currentFileSize = 0
Expand Down

0 comments on commit 4ce5ca6

Please sign in to comment.