From 6141ea5c6b8d38e2bfb2f9a12ba7a76c660db7b2 Mon Sep 17 00:00:00 2001 From: Lassi Kortela Date: Sun, 23 Jun 2019 12:23:03 +0300 Subject: [PATCH] Require at least one null byte to pad tar string --- trivial-tar-writer.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trivial-tar-writer.scm b/trivial-tar-writer.scm index 004a4ac..a70f792 100644 --- a/trivial-tar-writer.scm +++ b/trivial-tar-writer.scm @@ -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)))