From a5ee06528fde2286b0ea51e3739ccaee18c52cd274b691b836e291d731ef47e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 7 Aug 2024 17:15:44 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main patch revision 9750df08e7199381709ad94ff1299094 --- CVE-2019-20633.patch | 25 +++++++++++++++++++++++++ patch.changes | 5 +++++ patch.spec | 2 ++ 3 files changed, 32 insertions(+) create mode 100644 CVE-2019-20633.patch diff --git a/CVE-2019-20633.patch b/CVE-2019-20633.patch new file mode 100644 index 0000000..9ad3cd1 --- /dev/null +++ b/CVE-2019-20633.patch @@ -0,0 +1,25 @@ +commit a09d9519a57e84d8e2ad592fbba09e8a9faf55f8 +Author: Wolfgang Frisch +Date: Tue Jul 30 14:17:32 2024 +0200 + + Fix double-free/OOB read in pch.c (CVE-2019-20633) + + see also: https://savannah.gnu.org/bugs/index.php?56683#comment1 + +diff --git a/src/pch.c b/src/pch.c +index fd9c480..57c76de 100644 +--- a/src/pch.c ++++ b/src/pch.c +@@ -1183,8 +1183,11 @@ another_hunk (enum diff difftype, bool rev) + while (p_end >= 0) { + if (p_end == p_efake) + p_end = p_bfake; /* don't free twice */ +- else ++ else { + free(p_line[p_end]); ++ p_line[p_end] = NULL; ++ p_len[p_end] = 0; ++ } + p_end--; + } + assert(p_end == -1); diff --git a/patch.changes b/patch.changes index 059f82b..7fd599f 100644 --- a/patch.changes +++ b/patch.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jul 30 12:19:54 UTC 2024 - Wolfgang Frisch + +- CVE-2019-20633.patch: Fix double-free/OOB read in pch.c (bsc#1167721) + ------------------------------------------------------------------- Tue May 24 14:16:43 UTC 2022 - Stephan Kulow diff --git a/patch.spec b/patch.spec index 4de0f95..a15f0e3 100644 --- a/patch.spec +++ b/patch.spec @@ -40,6 +40,7 @@ Patch10: fix-swapping-fake-lines-in-pch_swap.patch Patch11: abort-when-cleaning-up-fails.patch Patch12: dont-follow-symlinks-unless-asked.patch Patch13: pass-the-correct-stat-to-backup-files.patch +Patch14: CVE-2019-20633.patch # See bnc#662957. The fix for CVE-2010-4651 breaks the way interdiff was # invoking patch, so interdiff had to be fixed too. Conflicts: patchutils < 0.3.2 @@ -67,6 +68,7 @@ changed files (generated by the diff command) to the original files. %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 %build export CFLAGS="%{optflags} -Wall -O2 -pipe"