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 8d63c6f commit 6997d0c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/tar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export class TarStream {
currentFileSize = 0

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

0 comments on commit 6997d0c

Please sign in to comment.