[file-roller: 1/2] Fix use-after-free in error message reporting
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller: 1/2] Fix use-after-free in error message reporting
- Date: Sun, 4 Apr 2021 06:52:45 +0000 (UTC)
commit d69e94737f5b4ca6d343257c2bbb8bec625afd86
Author: Badel2 <2badel2 gmail com>
Date: Mon Feb 22 22:48:21 2021 +0000
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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]