Require at least one null byte to pad tar string
This commit is contained in:
parent
0ac8f79e50
commit
8aa80e16c0
|
@ -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)))
|
||||
|
||||
|
|
Loading…
Reference in New Issue