From f035da9fa544c9405f3515b50baa5816a2d91042 Mon Sep 17 00:00:00 2001 From: Kou Wenqi Date: Tue, 21 Jun 2022 09:16:41 +0800 Subject: [PATCH] fix a potential infinite loop --- fix-a-potential-infinite-loop.patch | 27 +++++++++++++++++++++++++++ libdb.spec | 7 ++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 fix-a-potential-infinite-loop.patch diff --git a/fix-a-potential-infinite-loop.patch b/fix-a-potential-infinite-loop.patch new file mode 100644 index 0000000..5501489 --- /dev/null +++ b/fix-a-potential-infinite-loop.patch @@ -0,0 +1,27 @@ +From 7fe098ae34b54d41ec9273c7ae51ee8e708c8193 Mon Sep 17 00:00:00 2001 +From: Kou Wenqi +Date: Mon, 20 Jun 2022 17:31:32 +0800 +Subject: [PATCH] fix a potential infinite loop + +--- + src/dbinc/shqueue.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/dbinc/shqueue.h b/src/dbinc/shqueue.h +index 5fdbf47..8f185b5 100644 +--- a/src/dbinc/shqueue.h ++++ b/src/dbinc/shqueue.h +@@ -261,8 +261,8 @@ struct { \ + #define SH_TAILQ_NEXTP(elm, field, type) \ + ((struct type *)((u_int8_t *)(elm) + (elm)->field.stqe_next)) + +-#define SH_TAILQ_NEXT(elm, field, type) \ +- ((elm)->field.stqe_next == -1 ? NULL : \ ++#define SH_TAILQ_NEXT(elm, field, type) \ ++ (((elm)->field.stqe_next == -1 || (elm)->field.stqe_next == 0) ? NULL : \ + ((struct type *)((u_int8_t *)(elm) + (elm)->field.stqe_next))) + + /* +-- +2.23.0 + diff --git a/libdb.spec b/libdb.spec index 9580333..a477b0a 100644 --- a/libdb.spec +++ b/libdb.spec @@ -1,6 +1,6 @@ Name: libdb Version: 5.3.28 -Release: 37 +Release: 38 Summary: The Berkeley DB database library for C License: BSD and LGPLv2 and Sleepycat URL: https://www.oracle.com/database/berkeley-db/ @@ -38,6 +38,7 @@ Patch9000: bugfix-fix-deadlock-on-mempool-file-locks.patch Patch9001: libdb-limit-cpu.patch patch9002: libdb-cbd-race.patch +Patch9003: fix-a-potential-infinite-loop.patch BuildRequires: gcc gcc-c++ perl-interpreter libtool tcl-devel >= 8.5.2-3 BuildRequires: java-devel >= 1:1.6.0 chrpath zlib-devel @@ -119,6 +120,7 @@ popd %patch9001 -p1 %patch9002 -p1 +%patch9003 -p1 pushd dist ./s_config @@ -211,6 +213,9 @@ mv man/* %{buildroot}%{_mandir}/man1/ %{_mandir}/man1 %changelog +* Tue Jun 21 2022 Kou Wenqi - 5.3.28-38 +- Fix a potential infinite loop + * Mon Apr 19 2021 wangchen - 5.3.28-37 - Fix CVE-2019-2708 -- Gitee