Require at least one null byte to pad tar string

This commit is contained in:
Lassi Kortela 2019-06-23 12:23:03 +03:00
parent e6d45ea173
commit 6141ea5c6b
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@
(define (tar-poke-string! header at nbyte string)
(let* ((bytes (string->utf8 string))
(nnull (- nbyte (bytevector-length bytes))))
(when (< nnull 0) (error "tar: string too long"))
(when (< nnull 1) (error "tar: string too long"))
(bytevector-copy! header at bytes)
(bytevector-copy! header (+ at (bytevector-length bytes)) nulls 0 nnull)))