[hackers] [sbase][PATCH] tar: chktar: fix conditional typo

From: Elie Le Vaillant <eolien55_AT_disroot.org>
Date: Tue, 5 Mar 2024 21:20:57 +0100

---
 tar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tar.c b/tar.c
index 0361b63..405b8d9 100644
--- a/tar.c
+++ b/tar.c
_AT_@ -423,7 +423,7 @@ chktar(struct header *h)
 		goto bad;
 	}
 	memcpy(tmp, h->chksum, sizeof(tmp));
-	for (i = 0; i < sizeof(tmp), tmp[i] == ' '; i++);
+	for (i = 0; i < sizeof(tmp) && tmp[i] == ' '; i++);
 	for (; i < sizeof(tmp); i++)
 		if (tmp[i] == ' ')
 			tmp[i] = '\0';
-- 
2.44.0
Received on Tue Mar 05 2024 - 21:20:57 CET

This archive was generated by hypermail 2.3.0 : Tue Mar 05 2024 - 21:24:35 CET