libarchive/libarchive-3.5.3-Fix-CVE-2026-14164_part2.patch
Pavol Sloboda 07918d4140 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-190435
2026-08-11 13:07:55 +02:00

24 lines
933 B
Diff

diff -Naur libarchive-3.5.3/libarchive/archive_read_support_format_rar5.c libarchive-3.5.3_patched/libarchive/archive_read_support_format_rar5.c
--- libarchive-3.5.3/libarchive/archive_read_support_format_rar5.c 2026-07-16 14:03:13.630225900 +0200
+++ libarchive-3.5.3_patched/libarchive/archive_read_support_format_rar5.c 2026-07-16 14:04:51.393140499 +0200
@@ -2340,6 +2340,9 @@
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)
@@ -2347,9 +2350,6 @@
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;
}
rar->cstate.write_ptr = 0;