Blame SOURCES/libtar-1.2.20-CVE-2021-33645-CVE-2021-33646.patch

dc7088
From 78e95da690556874baac96dd1d655e577c6d8e95 Mon Sep 17 00:00:00 2001
dc7088
From: Kamil Dudka <kdudka@redhat.com>
dc7088
Date: Tue, 4 Oct 2022 10:39:35 +0200
dc7088
Subject: [PATCH] free memory allocated by gnu_long* fields
dc7088
dc7088
---
dc7088
 lib/handle.c | 7 +++++--
dc7088
 1 file changed, 5 insertions(+), 2 deletions(-)
dc7088
dc7088
diff --git a/lib/handle.c b/lib/handle.c
dc7088
index 28a7dc2..18bd8dc 100644
dc7088
--- a/lib/handle.c
dc7088
+++ b/lib/handle.c
dc7088
@@ -122,8 +122,11 @@ tar_close(TAR *t)
dc7088
 		libtar_hash_free(t->h, ((t->oflags & O_ACCMODE) == O_RDONLY
dc7088
 					? free
dc7088
 					: (libtar_freefunc_t)tar_dev_free));
dc7088
-	if (t->th_pathname != NULL)
dc7088
-		free(t->th_pathname);
dc7088
+
dc7088
+	free(t->th_pathname);
dc7088
+	free(t->th_buf.gnu_longname);
dc7088
+	free(t->th_buf.gnu_longlink);
dc7088
+
dc7088
 	free(t);
dc7088
 
dc7088
 	return i;
dc7088
-- 
dc7088
2.38.1
dc7088