Skip to content

Commit f36c8d9

Browse files
authored
Patch libdb for CVE-2020-13435 [Medium] (#12569)
1 parent 7ea53c9 commit f36c8d9

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

SPECS/libdb/CVE-2020-13435.patch

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 716c9cccdc0716b5e8e3cdd3f68fae702f255861 Mon Sep 17 00:00:00 2001
2+
From: Rohit Rawat <[email protected]>
3+
Date: Wed, 19 Feb 2025 16:59:21 +0000
4+
Subject: [PATCH] CVE-2020-13435
5+
6+
Taken from https://www.sqlite.org/src/info/572105de1d44bca4
7+
---
8+
lang/sql/sqlite/src/expr.c | 10 ++++++++--
9+
1 file changed, 8 insertions(+), 2 deletions(-)
10+
11+
diff --git a/lang/sql/sqlite/src/expr.c b/lang/sql/sqlite/src/expr.c
12+
index c0e9ba6..a253446 100644
13+
--- a/lang/sql/sqlite/src/expr.c
14+
+++ b/lang/sql/sqlite/src/expr.c
15+
@@ -2280,7 +2280,10 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
16+
switch( op ){
17+
case TK_AGG_COLUMN: {
18+
AggInfo *pAggInfo = pExpr->pAggInfo;
19+
- struct AggInfo_col *pCol = &pAggInfo->aCol[pExpr->iAgg];
20+
+ struct AggInfo_col *pCol;
21+
+ assert( pAggInfo!=0 );
22+
+ assert( pExpr->iAgg>=0 && pExpr->iAgg<pAggInfo->nColumn );
23+
+ pCol = &pAggInfo->aCol[pExpr->iAgg];
24+
if( !pAggInfo->directMode ){
25+
assert( pCol->iMem>0 );
26+
inReg = pCol->iMem;
27+
@@ -2514,7 +2517,10 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
28+
}
29+
case TK_AGG_FUNCTION: {
30+
AggInfo *pInfo = pExpr->pAggInfo;
31+
- if( pInfo==0 ){
32+
+ if( pInfo==0
33+
+ || NEVER(pExpr->iAgg<0)
34+
+ || NEVER(pExpr->iAgg>=pInfo->nFunc)
35+
+ ){
36+
assert( !ExprHasProperty(pExpr, EP_IntValue) );
37+
sqlite3ErrorMsg(pParse, "misuse of aggregate: %s()", pExpr->u.zToken);
38+
}else{
39+
--
40+
2.40.4
41+

SPECS/libdb/libdb.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
Summary: The Berkley DB database library for C
22
Name: libdb
33
Version: 5.3.28
4-
Release: 8%{?dist}
4+
Release: 9%{?dist}
55
License: BSD
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
88
Group: System/Libraries
99
URL: https://oss.oracle.com/berkeley-db.html
1010
Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz
1111
Patch0: CVE-2019-2708.patch
12+
Patch1: CVE-2020-13435.patch
1213
Obsoletes: db
1314

1415
%description
@@ -92,6 +93,9 @@ find %{buildroot} -type f -name "*.la" -delete -print
9293
%{_bindir}/db*_tuner
9394

9495
%changelog
96+
* Fri Feb 21 2025 Rohit Rawat <[email protected]> - 5.3.28-9
97+
- Patch CVE-2020-13435
98+
9599
* Thu May 16 2024 Daniel McIlvaney <[email protected]> - 5.3.28-8
96100
- Sanitize license files
97101

0 commit comments

Comments
 (0)