git: 9front

Download patch

ref: 2191d72205863d2c53ea6ac36991cb4c13204c7c
parent: 7b3bb0ea7536e695061d68d5d0710a6f0e7aa3bc
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Jan 23 15:08:11 EST 2026

tar: fix off by one with exactly 100-char dirs

--- a/sys/src/cmd/tar.c
+++ b/sys/src/cmd/tar.c
@@ -1073,7 +1073,8 @@
 		sysfatal("can't fstat %s: %r", file);
 
 	hpath = file;
-	if(strlen(file) > Namsiz){
+	/* reserve 1 byte for the '/' if we have dir */
+	if(strlen(file)+1 > Namsiz){
 		if(mkpaxhdr(ar, dir, file) < 0)
 			goto Badhdr;
 		hpath = "PAXED";
--