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

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