File 0001-Fix-use-after-free-in-error-message-reporting.patch of Package file-roller

From d69e94737f5b4ca6d343257c2bbb8bec625afd86 Mon Sep 17 00:00:00 2001
From: Badel2 <2badel2@gmail.com>
Date: Mon, 22 Feb 2021 22:48:21 +0000
Subject: [PATCH] Fix use-after-free in error message reporting

archive_error_string (a) must be called before archive_read_free (a)
so that _g_error_new_from_archive_error can copy the error string.
Otherwise load_data->error is set to "Fatal error" or gibberish instead of the
proper error message
---
 src/fr-archive-libarchive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fr-archive-libarchive.c b/src/fr-archive-libarchive.c
index 12ab16e3..4f698ee4 100644
--- a/src/fr-archive-libarchive.c
+++ b/src/fr-archive-libarchive.c
@@ -498,7 +498,6 @@ list_archive_thread (GSimpleAsyncResult *result,
 
 		archive_read_data_skip (a);
 	}
-	archive_read_free (a);
 
 	if ((load_data->error == NULL) && (r != ARCHIVE_EOF) && (archive_error_string (a) != NULL))
 		load_data->error = _g_error_new_from_archive_error (archive_error_string (a));
@@ -507,6 +506,7 @@ list_archive_thread (GSimpleAsyncResult *result,
 	if (load_data->error != NULL)
 		g_simple_async_result_set_from_error (result, load_data->error);
 
+	archive_read_free (a);
 	load_data_free (load_data);
 }
 
-- 
2.31.1

openSUSE Build Service is sponsored by