diff --git a/fix-a-potential-infinite-loop.patch b/fix-a-potential-infinite-loop.patch new file mode 100644 index 0000000000000000000000000000000000000000..5501489e5fb7d638de0aed3a2d3888410f220122 --- /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 5af3d036897d6f7cce834e1e10e95312eb85818c..6d8770b87ac79e5d70854b536cfd8b003f9e822d 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 @@ Patch38: bugfix-fix-deadlock-on-mempool-file-locks.patch Patch39: libdb-limit-cpu.patch patch40: libdb-cbd-race.patch Patch41: add-check-for-device-number-in-__check_lock_fn.patch +Patch42: 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 @@ -118,6 +119,7 @@ popd %patch39 -p1 %patch40 -p1 %patch41 -p1 +%patch42 -p1 pushd dist ./s_config @@ -210,6 +212,9 @@ mv man/* %{buildroot}%{_mandir}/man1/ %{_mandir}/man1 %changelog +* Tue Jul 12 2022 Kou Wenqi - 5.3.28-38 +- Fix a potential infinite loop + * Tue Jun 28 2022 panxiaohe - 5.3.28-37 - add check for device number in __check_lock_fn