Require at least one null byte to pad tar string
This commit is contained in:
		
							parent
							
								
									e6d45ea173
								
							
						
					
					
						commit
						6141ea5c6b
					
				| 
						 | 
				
			
			@ -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