not fail ungracefully (SIGSEGV) when the rar5 issue described in CVE-2026-14164 occurs Related: RHEL-190435
24 lines
933 B
Diff
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;
|