libarchive/0008-Fix-CVE-2026-14164_part2.patch
Pavol Sloboda 640e340574 Added the other part of the fix for CVE-2026-14164 so libarchive does
not fail ungracefully (SIGSEGV) when the rar5 issue described in
CVE-2026-14164 occurs

Related: RHEL-190437
2026-08-11 13:01:25 +02:00

25 lines
903 B
Diff

diff --git a/libarchive/archive_read_support_format_rar5.c b/libarchive/archive_read_support_format_rar5.c
index 683e35e065..1f8f8f4359 100644
--- a/libarchive/archive_read_support_format_rar5.c
+++ b/libarchive/archive_read_support_format_rar5.c
@@ -2568,6 +2568,9 @@ static int init_unpack(struct rar5* rar) {
free(rar->cstate.window_buf);
free(rar->cstate.filtered_buf);
+ rar->cstate.window_buf = NULL;
+ rar->cstate.filtered_buf = NULL;
+
if(rar->cstate.window_size > 0) {
rar->cstate.window_buf = calloc(1, rar->cstate.window_size);
if(rar->cstate.window_buf == NULL)
@@ -2575,9 +2578,6 @@ static int init_unpack(struct rar5* rar) {
rar->cstate.filtered_buf = calloc(1, rar->cstate.window_size);
if(rar->cstate.filtered_buf == NULL)
return ARCHIVE_FATAL;
- } else {
- rar->cstate.window_buf = NULL;
- rar->cstate.filtered_buf = NULL;
}
clear_data_ready_stack(rar);