fix a potential infinite loop

This commit is contained in:
Kou Wenqi 2022-06-21 09:16:41 +08:00
parent 6450d79cd8
commit f035da9fa5
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From 7fe098ae34b54d41ec9273c7ae51ee8e708c8193 Mon Sep 17 00:00:00 2001
From: Kou Wenqi <kouwenqi@kylinos.cn>
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

View File

@ -1,6 +1,6 @@
Name: libdb Name: libdb
Version: 5.3.28 Version: 5.3.28
Release: 37 Release: 38
Summary: The Berkeley DB database library for C Summary: The Berkeley DB database library for C
License: BSD and LGPLv2 and Sleepycat License: BSD and LGPLv2 and Sleepycat
URL: https://www.oracle.com/database/berkeley-db/ 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 Patch9001: libdb-limit-cpu.patch
patch9002: libdb-cbd-race.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: gcc gcc-c++ perl-interpreter libtool tcl-devel >= 8.5.2-3
BuildRequires: java-devel >= 1:1.6.0 chrpath zlib-devel BuildRequires: java-devel >= 1:1.6.0 chrpath zlib-devel
@ -119,6 +120,7 @@ popd
%patch9001 -p1 %patch9001 -p1
%patch9002 -p1 %patch9002 -p1
%patch9003 -p1
pushd dist pushd dist
./s_config ./s_config
@ -211,6 +213,9 @@ mv man/* %{buildroot}%{_mandir}/man1/
%{_mandir}/man1 %{_mandir}/man1
%changelog %changelog
* Tue Jun 21 2022 Kou Wenqi <kouwenqi@kylinos.cn> - 5.3.28-38
- Fix a potential infinite loop
* Mon Apr 19 2021 wangchen <wangchen137@huawei.com> - 5.3.28-37 * Mon Apr 19 2021 wangchen <wangchen137@huawei.com> - 5.3.28-37
- Fix CVE-2019-2708 - Fix CVE-2019-2708