Compare commits

...

18 Commits

Author SHA1 Message Date
openeuler-ci-bot 58a0fe3119 !64 [sync] PR-60: 修复 CVE-2022-35737
From: @openeuler-sync-bot 
Reviewed-by: @bzhaoop 
Signed-off-by: @bzhaoop
2022-08-26 06:19:22 +00:00
liusirui 0ceaaa30b0 fix CVE-2022-35737
(cherry picked from commit 419bd31973)
2022-08-26 11:30:44 +08:00
openeuler-ci-bot c135d8d9cf !54 【轻量级 PR】:fix spec changelog date error
From: @jxy_git 
Reviewed-by: @bzhaoop 
Signed-off-by: @bzhaoop
2022-06-14 00:52:52 +00:00
jiangxinyu a5ad049268 fix spec changelog date error 2022-06-08 06:56:04 +00:00
openeuler-ci-bot ae04b38c7e !49 Fix the CVE-2021-36690.
From: @wbq_sky
Reviewed-by: @bzhaoop
Signed-off-by: @bzhaoop
2021-11-27 09:13:46 +00:00
wbq_sky 281ace3ce4 fix the CVE-2021-36690
Signed-off-by: wbq_sky <wangbingquan@huawei.com>
2021-11-27 14:08:25 +08:00
openeuler-ci-bot fa6537c498 !47 Update the sqlite to 3.36
From: @wbq_sky
Reviewed-by: @bzhaoop
Signed-off-by: @bzhaoop
2021-11-25 07:34:38 +00:00
wbq_sky 70773bbab5 update to 3.36.0
Signed-off-by: wbq_sky <wangbingquan@huawei.com>
2021-11-25 08:45:52 +08:00
openeuler-ci-bot 17f47bf553 !40 Fix the uninitialized value used in pattern compare function.
From: @wbq_sky
Reviewed-by: @bzhaoop
Signed-off-by: @bzhaoop
2021-09-27 12:01:15 +00:00
wbq_sky c7b6d9b65f fix the uninitialized value used in pattern match
Signed-off-by: wbq_sky <wangbingquan@huawei.com>
2021-09-26 16:28:27 +08:00
openeuler-ci-bot 80491f4558 !39 Fix a problem caused by using an SQL variable in an over clause within a trigger.
From: @wbq_sky
Reviewed-by: @bzhaoop
Signed-off-by: @bzhaoop
2021-09-13 12:28:19 +00:00
wbq_sky b5acf1da61 fix the null reference in the over clause within trigger
Signed-off-by: wbq_sky <wangbingquan@huawei.com>
2021-09-10 14:19:45 +08:00
openeuler-ci-bot 4cbaf5da18 !38 fix the problem of the infinite loop in trim function.
From: @wbq_sky
Reviewed-by: @bzhaoop
Signed-off-by: @bzhaoop
2021-09-10 02:59:56 +00:00
wbq_sky d81186e427 fix the infinite loop in the trim function while the pattern is well formed.
Signed-off-by: wbq_sky <wangbingquan@huawei.com>
2021-09-10 10:54:13 +08:00
openeuler-ci-bot d0aa7d2f6e !30 update 3.34.0
From: @markeryang
Reviewed-by: @liuzhiqiang26
Signed-off-by: @volcanodragon
2021-02-01 09:54:48 +08:00
markeryang 518b78e0c5 update to 3.34.0 2021-01-28 16:06:55 +08:00
openeuler-ci-bot e27e46aeb6 !27 update source0 url in spec file
Merge pull request !27 from lihaotian/master
2020-09-03 11:57:20 +08:00
lihaotian9 77937f0d9f Update the source0 url in spec file 2020-09-03 10:21:16 +08:00
7 changed files with 158 additions and 6 deletions
+44
View File
@@ -0,0 +1,44 @@
diff -rNu a/ext/expert/sqlite3expert.c b/ext/expert/sqlite3expert.c
--- a/ext/expert/sqlite3expert.c 2021-11-25 09:00:19.267831518 +0800
+++ b/ext/expert/sqlite3expert.c 2021-11-25 09:07:38.551969861 +0800
@@ -690,11 +690,13 @@
rc = idxPrintfPrepareStmt(db, &p1, pzErrmsg, "PRAGMA table_xinfo=%Q", zTab);
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(p1) ){
const char *zCol = (const char*)sqlite3_column_text(p1, 1);
+ const char *zColSeq = 0;
nByte += 1 + STRLEN(zCol);
rc = sqlite3_table_column_metadata(
- db, "main", zTab, zCol, 0, &zCol, 0, 0, 0
+ db, "main", zTab, zCol, 0, &zColSeq, 0, 0, 0
);
- nByte += 1 + STRLEN(zCol);
+ if( zColSeq==0 ) zColSeq = "binary";
+ nByte += 1 + STRLEN(zColSeq);
nCol++;
nPk += (sqlite3_column_int(p1, 5)>0);
}
@@ -714,6 +716,7 @@
nCol = 0;
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(p1) ){
const char *zCol = (const char*)sqlite3_column_text(p1, 1);
+ const char *zColSeq = 0;
int nCopy = STRLEN(zCol) + 1;
pNew->aCol[nCol].zName = pCsr;
pNew->aCol[nCol].iPk = (sqlite3_column_int(p1, 5)==1 && nPk==1);
@@ -721,12 +724,13 @@
pCsr += nCopy;
rc = sqlite3_table_column_metadata(
- db, "main", zTab, zCol, 0, &zCol, 0, 0, 0
+ db, "main", zTab, zCol, 0, &zColSeq, 0, 0, 0
);
if( rc==SQLITE_OK ){
- nCopy = STRLEN(zCol) + 1;
+ if( zColSeq==0 ) zColSeq = "binary";
+ nCopy = STRLEN(zColSeq) + 1;
pNew->aCol[nCol].zColl = pCsr;
- memcpy(pCsr, zCol, nCopy);
+ memcpy(pCsr, zColSeq, nCopy);
pCsr += nCopy;
}
+80
View File
@@ -0,0 +1,80 @@
From effc07ec9c6e08d3bd17665f8800054770f8c643 Mon Sep 17 00:00:00 2001
From: drh <>
Date: Fri, 15 Jul 2022 12:34:31 +0000
Subject: [PATCH] Fix the whereKeyStats() routine (part of STAT4 processing
only) so that it is able to cope with row-value comparisons against the
primary key index of a WITHOUT ROWID table.
[forum:/forumpost/3607259d3c|Forum post 3607259d3c].
FossilOrigin-Name: 2a6f761864a462de5c2d5bc666b82fb0b7e124a03443cd1482620dde344b34bb
---
src/where.c | 4 ++--
test/rowvalue.test | 31 +++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/src/where.c b/src/where.c
index de6ea91e3..110eb4845 100644
--- a/src/where.c
+++ b/src/where.c
@@ -1433,7 +1433,7 @@ static int whereKeyStats(
#endif
assert( pRec!=0 );
assert( pIdx->nSample>0 );
- assert( pRec->nField>0 && pRec->nField<=pIdx->nSampleCol );
+ assert( pRec->nField>0 );
/* Do a binary search to find the first sample greater than or equal
** to pRec. If pRec contains a single field, the set of samples to search
@@ -1479,7 +1479,7 @@ static int whereKeyStats(
** it is extended to two fields. The duplicates that this creates do not
** cause any problems.
*/
- nField = pRec->nField;
+ nField = MIN(pRec->nField, pIdx->nSample);
iCol = 0;
iSample = pIdx->nSample * nField;
do{
diff --git a/test/rowvalue.test b/test/rowvalue.test
index 12fee8237..59b44d938 100644
--- a/test/rowvalue.test
+++ b/test/rowvalue.test
@@ -751,4 +751,35 @@ do_execsql_test 30.3 {
+# 2022-07-15
+# https://sqlite.org/forum/forumpost/3607259d3c
+#
+reset_db
+do_execsql_test 33.1 {
+ CREATE TABLE t1(a INT, b INT PRIMARY KEY) WITHOUT ROWID;
+ INSERT INTO t1(a, b) VALUES (0, 1),(15,-7),(3,100);
+ ANALYZE;
+} {}
+do_execsql_test 33.2 {
+ SELECT * FROM t1 WHERE (b,a) BETWEEN (0,5) AND (99,-2);
+} {0 1}
+do_execsql_test 33.3 {
+ SELECT * FROM t1 WHERE (b,a) BETWEEN (-8,5) AND (0,-2);
+} {15 -7}
+do_execsql_test 33.3 {
+ SELECT * FROM t1 WHERE (b,a) BETWEEN (3,5) AND (100,4);
+} {3 100}
+do_execsql_test 33.3 {
+ SELECT * FROM t1 WHERE (b,a) BETWEEN (3,5) AND (100,2);
+} {}
+do_execsql_test 33.3 {
+ SELECT * FROM t1 WHERE (a,b) BETWEEN (-2,99) AND (1,0);
+} {0 1}
+do_execsql_test 33.3 {
+ SELECT * FROM t1 WHERE (a,b) BETWEEN (14,99) AND (16,0);
+} {15 -7}
+do_execsql_test 33.3 {
+ SELECT * FROM t1 WHERE (a,b) BETWEEN (2,99) AND (4,0);
+} {3 100}
+
finish_test
--
2.25.1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+34 -6
View File
@@ -1,22 +1,24 @@
%bcond_without check
%global extver 3320300
%global extver 3360000
%global tcl_version 8.6
%global tcl_sitearch %{_libdir}/tcl%{tcl_version}
Name: sqlite
Version: 3.32.3
Release: 2
Version: 3.36.0
Release: 3
Summary: Embeded SQL database
License: Public Domain
URL: http://www.sqlite.org/
Source0: http://www.sqlite.org/2020/sqlite-src-%{extver}.zip
Source1: http://www.sqlite.org/2020/sqlite-doc-%{extver}.zip
Source2: https://www.sqlite.org/2020/sqlite-autoconf-%{extver}.tar.gz
Source0: https://www.sqlite.org/2021/sqlite-src-%{extver}.zip
Source1: http://www.sqlite.org/2021/sqlite-doc-%{extver}.zip
Source2: https://www.sqlite.org/2021/sqlite-autoconf-%{extver}.tar.gz
Patch1: 0001-sqlite-no-malloc-usable-size.patch
Patch2: 0002-remove-fail-testcase-in-no-free-fd-situation.patch
Patch3: 0003-CVE-2021-36690.patch
Patch4: 0004-CVE-2022-35737.patch
BuildRequires: gcc autoconf tcl tcl-devel
BuildRequires: ncurses-devel readline-devel glibc-devel
@@ -61,6 +63,8 @@ This contains man files and HTML files for the using of sqlite.
%setup -q -a1 -n %{name}-src-%{extver}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
rm -f %{name}-doc-%{extver}/sqlite.css~ || :
@@ -131,6 +135,30 @@ make test
%{_mandir}/man*/*
%changelog
* Tue Aug 16 2022 liusirui <liusirui@huawei.com> - 3.36.0-3
- fix the CVE-2022-35737.
* Sat Nov 27 2021 wbq_sky <wangbingquan@huawei.com> - 3.36.0-2
- fix the CVE-2021-36690.
* Fri Nov 25 2021 wbq_sky <wangbingquan@huawei.com> - 3.36.0-1
- update to 3.36.0.
* Fri Sep 26 2021 wbq_sky <wangbingquan@huawei.com> - 3.34.0-4
- fix the uninitialized value used in pattern match.
* Fri Sep 3 2021 wbq_sky <wangbingquan@huawei.com> - 3.34.0-3
- fix the null reference in the tigger statement.
* Fri Sep 3 2021 wbq_sky <wangbingquan@huawei.com> - 3.34.0-2
- fix the infinite loop problem in the trim function while the pattern is well formed.
* Thu Jan 14 2021 yanglongkang <yanglongkang@huawei.com> - 3.34.0-1
- update package to 3.34.0
* Thu Sep 3 2020 lihaotian<lihaotian9@huawei.com> - 3.32.3-3
- update source0 url
* Tue Jul 21 2020 jixinjie <jixinjie@huawei.com> - 3.32.3-2
- update yaml file